LinkButton with OnClientClick and PostBackUrl not workng properly
-
Monday, July 23, 2012 5:09 AM
Hi
I have an asp.net page which post some values to a page on an external website. I have used LinkButton to post the values. I want the external page to be opened on a new window
<asp:LinkButtonID="LinkSubmit"runat="server"OnClientClick="form1.target='_blank'"PostBackUrl="https://adm.com/gway/default.aspx"Text="Launch"/>
In my page I have a DropDownList, whose selected value(posted to the external site) determines the page to be opened on the external website. When I select a value in the DropDownList and click on the LinkButton it works fine, opening the external page on another window but when I come back to my page and change the selection in the DropDownList, even without clicking the LinkButton another window is popped up with the previous results and not for the changed value of the DropDownList.
Why does this happen? Could anybody suggest a good way to solve the issue?
Thanks..
All Replies
-
Monday, July 23, 2012 8:36 AM
Hi,
you may like to try this asp.net specific forum.... http://forums.asp.net/130.aspx/1?HTML+CSS+and+JavaScript
probably your issue has something to do with the FormState since the form postback is redirected to another page in a new window....
try placing breakpoints in the code behind on the linkSubmit onclick and in the page_load event handlers... I expect that you should see two postbacks i/o one.
Include a link to your website... the asp.net code you have provided looks malformed.... attributes must be separated by spaces... do you have VS intellisence and error detection turned on?
Rob^_^
- Marked As Answer by Allen Li - MSFTModerator Monday, July 30, 2012 2:55 AM


