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










0















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].










share|improve this question


























    0















    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].










    share|improve this question
























      0












      0








      0








      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].










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      FalcoGerFalcoGer

      479113




      479113






















          1 Answer
          1






          active

          oldest

          votes


















          1














          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>







          share|improve this answer






















            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
            );



            );













            draft saved

            draft discarded


















            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









            1














            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>







            share|improve this answer



























              1














              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>







              share|improve this answer

























                1












                1








                1







                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>







                share|improve this answer













                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>








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 2 days ago









                VladimirVladimir

                71348




                71348





























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                    Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                    Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved