# HTML asp PostBackUrl ?

**URL:** <https://boards.straightdope.com/t/html-asp-postbackurl/347576>\
**Category:** Factual Questions\
**Created:** [March 8, 2006, 8:13pm UTC](https://boards.straightdope.com/t/html-asp-postbackurl/347576 "2006-03-08T20:13:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![enipla](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@enipla](https://boards.straightdope.com/u/enipla)\
**Post date:** [March 8, 2006, 8:13pm UTC](https://boards.straightdope.com/t/html-asp-postbackurl/347576/1 "2006-03-08T20:13:47Z")

</div>

Is there a way to add the HiddenField value to the PostBackUrl as a variable?

Consider this code -

```auto

<asp:Button PostBackUrl="~/Default.aspx" ID="Button1" runat="server" Text="ASP BUTTON" /></div>
   
<asp:HiddenField ID="SaveXML" runat=server Value="False" />

```

Something like this -

```auto

<asp:Button **PostBackUrl="~/Default.aspx?Cmd=&"+SaveXML.value** ID="Button1" runat="server" Text="ASP BUTTON" /></div>

```

I’m really running into a brick wall here. Iv’e tried an on click event to call a sub routine, but the first think that happens when you click the button is the page\_load event fires and clears out all the hidden variables. Very strange. Maybe the PostBackUrl can save me.
