Webforms postback with multiple arguments2019 Community Moderator ElectionHow to get a post back parameter value in code-behindWhat is a postback?Invalid postback or callback argument. Event validation is enabled using '<pages enableEventValidation=“true”/>'Difference between a Postback and a CallbackHow do you handle multiple submit buttons in ASP.NET MVC Framework?jQuery UI Dialog with ASP.NET button postbackASP.NET postback with JavaScriptASP.net 4.0 Webforms Routing Postback IssueCalling manual AJAX functions in ASP.NET WebForms with postbacksC# ASP.net WebForms postback without update/refreshAccessing sequentially numbered controls in C# code behind
How does a sound wave propagate?
Cycles on the torus
An Undercover Army
Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?
I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?
Why is there an extra space when I type "ls" on the Desktop?
Was it really inappropriate to write a pull request for the company I interviewed with?
Inorganic chemistry handbook with reaction lists
Does the US political system, in principle, allow for a no-party system?
Does an unused member variable take up memory?
Why restrict private health insurance?
Professor forcing me to attend a conference, I can't afford even with 50% funding
Can the Witch Sight warlock invocation see through the Mirror Image spell?
Unfamiliar notation in Diabelli's "Duet in D" for piano
Boss Telling direct supervisor I snitched
Why would /etc/passwd be used every time someone executes `ls -l` command?
Will the concrete slab in a partially heated shed conduct a lot of heat to the unconditioned area?
How to distinguish easily different soldier of ww2?
Should I apply for my boss's promotion?
Why does a car's steering wheel get lighter with increasing speed
Tabular environment - text vertically positions itself by bottom of tikz picture in adjacent cell
Issue with units for a rocket nozzle throat area problem
Is this Paypal Github SDK reference really a dangerous site?
Where is the License file location for Identity Server in Sitecore 9.1?
Webforms postback with multiple arguments
2019 Community Moderator ElectionHow to get a post back parameter value in code-behindWhat is a postback?Invalid postback or callback argument. Event validation is enabled using '<pages enableEventValidation=“true”/>'Difference between a Postback and a CallbackHow do you handle multiple submit buttons in ASP.NET MVC Framework?jQuery UI Dialog with ASP.NET button postbackASP.NET postback with JavaScriptASP.net 4.0 Webforms Routing Postback IssueCalling manual AJAX functions in ASP.NET WebForms with postbacksC# ASP.net WebForms postback without update/refreshAccessing sequentially numbered controls in C# code behind
I wish to call the __doPostBack(eventTarget, eventArgument)
function. In the code file I would then read the arguments as usual like this: Dim param As String = Request("__EVENTARGUMENT")
. However this doesn't work for multiple arguments.
Someone here suggested that you could use a json or csv-list. Usually I would just choose a delimiter that sepeates my arguments. However in my case now the argument may contain any character, so I can't just decide on any delimiter, so I figured I'd use a JSON.
I tried this.
Markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', one: 'someText', two: 'moreText');">TestButton</button>
Code-File
If (IsPostBack) Then
Dim tgt As Object = Request("__EVENTTARGET")
Dim param As Object = Request("__EVENTARGUMENT") ' what datatype to use?
' [...]
' how to get arguments from json?
End If
Now how do I get my arguments back in the code? What datatype do I use for the parameters? Calling param.ToString()
only returns [object Object]
What's more, the arguments are generated in the code file in my actual application, and there may be different ones and some may be missing, using a simple array doesn't work for me as you can't determine after the fact which array position coresponds to which argument. And regardless it still gives me [object Object]
.
asp.net webforms postback dopostback
add a comment |
I wish to call the __doPostBack(eventTarget, eventArgument)
function. In the code file I would then read the arguments as usual like this: Dim param As String = Request("__EVENTARGUMENT")
. However this doesn't work for multiple arguments.
Someone here suggested that you could use a json or csv-list. Usually I would just choose a delimiter that sepeates my arguments. However in my case now the argument may contain any character, so I can't just decide on any delimiter, so I figured I'd use a JSON.
I tried this.
Markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', one: 'someText', two: 'moreText');">TestButton</button>
Code-File
If (IsPostBack) Then
Dim tgt As Object = Request("__EVENTTARGET")
Dim param As Object = Request("__EVENTARGUMENT") ' what datatype to use?
' [...]
' how to get arguments from json?
End If
Now how do I get my arguments back in the code? What datatype do I use for the parameters? Calling param.ToString()
only returns [object Object]
What's more, the arguments are generated in the code file in my actual application, and there may be different ones and some may be missing, using a simple array doesn't work for me as you can't determine after the fact which array position coresponds to which argument. And regardless it still gives me [object Object]
.
asp.net webforms postback dopostback
add a comment |
I wish to call the __doPostBack(eventTarget, eventArgument)
function. In the code file I would then read the arguments as usual like this: Dim param As String = Request("__EVENTARGUMENT")
. However this doesn't work for multiple arguments.
Someone here suggested that you could use a json or csv-list. Usually I would just choose a delimiter that sepeates my arguments. However in my case now the argument may contain any character, so I can't just decide on any delimiter, so I figured I'd use a JSON.
I tried this.
Markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', one: 'someText', two: 'moreText');">TestButton</button>
Code-File
If (IsPostBack) Then
Dim tgt As Object = Request("__EVENTTARGET")
Dim param As Object = Request("__EVENTARGUMENT") ' what datatype to use?
' [...]
' how to get arguments from json?
End If
Now how do I get my arguments back in the code? What datatype do I use for the parameters? Calling param.ToString()
only returns [object Object]
What's more, the arguments are generated in the code file in my actual application, and there may be different ones and some may be missing, using a simple array doesn't work for me as you can't determine after the fact which array position coresponds to which argument. And regardless it still gives me [object Object]
.
asp.net webforms postback dopostback
I wish to call the __doPostBack(eventTarget, eventArgument)
function. In the code file I would then read the arguments as usual like this: Dim param As String = Request("__EVENTARGUMENT")
. However this doesn't work for multiple arguments.
Someone here suggested that you could use a json or csv-list. Usually I would just choose a delimiter that sepeates my arguments. However in my case now the argument may contain any character, so I can't just decide on any delimiter, so I figured I'd use a JSON.
I tried this.
Markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', one: 'someText', two: 'moreText');">TestButton</button>
Code-File
If (IsPostBack) Then
Dim tgt As Object = Request("__EVENTTARGET")
Dim param As Object = Request("__EVENTARGUMENT") ' what datatype to use?
' [...]
' how to get arguments from json?
End If
Now how do I get my arguments back in the code? What datatype do I use for the parameters? Calling param.ToString()
only returns [object Object]
What's more, the arguments are generated in the code file in my actual application, and there may be different ones and some may be missing, using a simple array doesn't work for me as you can't determine after the fact which array position coresponds to which argument. And regardless it still gives me [object Object]
.
asp.net webforms postback dopostback
asp.net webforms postback dopostback
asked 2 days ago
FalcoGerFalcoGer
479113
479113
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
When your button is clicked, the page sends the following HTML form fields:
__EVENTTARGET: btn_postbackButton
__EVENTARGUMENT: [object Object]
To get your json on the server side as a string, use the following button markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', 'one: 'someText', two: 'moreText'');">TestButton</button>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023455%2fwebforms-postback-with-multiple-arguments%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
When your button is clicked, the page sends the following HTML form fields:
__EVENTTARGET: btn_postbackButton
__EVENTARGUMENT: [object Object]
To get your json on the server side as a string, use the following button markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', 'one: 'someText', two: 'moreText'');">TestButton</button>
add a comment |
When your button is clicked, the page sends the following HTML form fields:
__EVENTTARGET: btn_postbackButton
__EVENTARGUMENT: [object Object]
To get your json on the server side as a string, use the following button markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', 'one: 'someText', two: 'moreText'');">TestButton</button>
add a comment |
When your button is clicked, the page sends the following HTML form fields:
__EVENTTARGET: btn_postbackButton
__EVENTARGUMENT: [object Object]
To get your json on the server side as a string, use the following button markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', 'one: 'someText', two: 'moreText'');">TestButton</button>
When your button is clicked, the page sends the following HTML form fields:
__EVENTTARGET: btn_postbackButton
__EVENTARGUMENT: [object Object]
To get your json on the server side as a string, use the following button markup:
<button type="button" id="btn_postbackButton" onclick="__doPostBack('btn_postbackButton', 'one: 'someText', two: 'moreText'');">TestButton</button>
answered 2 days ago
VladimirVladimir
71348
71348
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023455%2fwebforms-postback-with-multiple-arguments%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown