Note that there are some explanatory texts on larger screens.

plurals
  1. POLinkButton doesn't Postback on first click in asp.net?
    primarykey
    data
    text
    <p>I have a <code>.aspx</code> Webpage with a <code>UserControl</code> added on it.In <code>UserControl</code> when the <code>LinkButton</code> is <code>clicked</code> it do not <code>Postback</code> on first attempt. but when we <code>click</code> again it does the <code>Postback</code> and then only the page redirects don't know why?</p> <p>Any idea?</p> <p><strong>In .ASPX Markup:</strong></p> <pre><code> &lt;asp:LinkButton ID="lnkCheckOut" runat="server" CssClass="button orange" onclick="lnkCheckOut_Click"&gt;Checkout&lt;/asp:LinkButton&gt; </code></pre> <p><strong>In.cs file:</strong></p> <pre><code>protected void lnkCheckOut_Click(object sender, EventArgs e) { if (Session["UserID"] != null) { lnkCheckOut.PostBackUrl = "~/checkout.aspx?type=checkout"; //Response.Redirect("~/checkout.aspx?type=checkout"); Session["IsQuoteAdded"] = "false"; } //if not logged in user else { lnkCheckOut.PostBackUrl = "~/login.aspx?returnUrl="+HttpUtility.UrlEncode(Request.RawUrl); } } </code></pre> <p>When i see markup in browser(using F12 in Chrome) on <strong>first click</strong> it shows:</p> <pre><code>&lt;a id="ctl00_ContentPlaceHolder1_shpCart_lnkCheckOut" class="button orange" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$shpCart$lnkCheckOut','')"&gt;Checkout&lt;/a&gt; </code></pre> <p><strong>On Second Click:</strong></p> <pre><code>&lt;a id="ctl00_ContentPlaceHolder1_shpCart_lnkCheckOut" class="button orange" href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ContentPlaceHolder1$shpCart$lnkCheckOut", "", false, "", "login.aspx?returnUrl=%2fNew%2fMyBox.aspx", false, true))'&gt;Checkout&lt;/a&gt; </code></pre> <p><strong>Note:I am not using any UpdatePanel in the Webpage or UserControl.</strong></p> <p>Help Appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload