Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Link button on master page not doing postback when redirecting to same content page by querystring asp.net C#.
Posted
Updated 22-Apr-13 21:28pm
v2
Comments
Karthik Harve 23-Apr-13 3:29am    
can you show your code written for redirecting to same page ?
satpal 2 23-Apr-13 3:30am    
yes..
satpal 2 23-Apr-13 3:31am    
<asp:UpdatePanel ID="UpdatePanelShiftApp" runat="server" Visible="False">
<contenttemplate>
<table width="600" align="center" style="border: solid 1px #cccccc;">
<tr>
<th colspan="2">
Shift Application
</th>
</tr>
<tr>
<td>
 
</td>
<td>
<asp:Label ID="lblmsg" runat="server" ForeColor="Red">
</td>
</tr>
<tr>
<td >
Language
</td>
<td align="left" ><%--style="padding-left:83px"--%>
<asp:DropDownList ID="ddlfont" CssClass="field" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="ddlfont_SelectedIndexChanged">
<asp:ListItem>Hindi
<asp:ListItem>English

</td>
</tr>
<tr>
<td>
Department
</td>
<td>
<asp:DropDownList ID="ddldepartment" CssClass="field" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="ddldepartment_SelectedIndexChanged" Width="300px">

<asp:RequiredFieldValidator ID="RequiredFieldValidator14" runat="server" ControlToValidate="ddldepartment"
EnableTheming="True" ErrorMessage="select department">*
</td>
</tr>
<tr>
<td>
Officers
</td>
<td>
<asp:DropDownList ID="ddlChoseofficer" CssClass="field" runat="server" onchange="return ViewOfficerAdd()"
Width="300px">

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlChoseofficer"
EnableTheming="True" ErrorMessage="select Officer">*
</td>
</tr>



<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Remarks">
</td>
<td>
<asp:TextBox ID="txtRemark" runat="server" CssClass="NewFont1" TextMode="MultiLine"
Width="300px">
</td>
</tr>
<tr>
<td>
 
satpal 2 23-Apr-13 3:40am    
There is grid where a link called "Shift Application Use" on clicking this link button above UpdatePanelShiftApp Panel become visible but then clicking on "logout" link button which is on master page not postback.

Here is Grid desig coding..and gvstatus_Rowcommand coding



<tr>
<td align="center" colspan="2">
<asp:GridView ID="gvstatus" Width="975" runat="server" AutoGenerateColumns="False"
DataKeyNames="Applicantid" EmptyDataText="No Record Found" OnRowCommand="gvstatus_RowCommand"
OnRowDataBound="gvstatus_RowDataBound">
<columns> <asp:ButtonField CommandName="ShiftApplication" Text="Shift Application Use">
<itemstyle width="50px" cssclass="FontEnglish">

<%-- <asp:BoundField DataField="Applicantid" HeaderText="Applicantid" Visible="false" />--%>
<asp:BoundField DataField="Applicantid" HeaderText="Application No." ReadOnly="true"
ItemStyle-CssClass="FontEnglish" Visible="true">
<itemstyle cssclass="FontEnglish" width="70">

<asp:BoundField DataField="DateOfApplicaton" HeaderText="Application Date" DataFormatString="{0:dd/MM/yyyy} "
ReadOnly="true" />
<asp:BoundField DataField="ApplicantName" HeaderText="Applicant Name" />
<asp:BoundField DataField="FatherName" HeaderText="Father Name" />
<asp:BoundField DataField="DOB" HeaderText="Date Of Birth" ItemStyle-Width="67" DataFormatString="{0:dd-MM-yyyy}" />
<asp:BoundField DataField="Gender" HeaderText="Gender" />
<asp:BoundField DataField="Caste" HeaderText="Caste" ItemStyle-Width="60" />
<asp:BoundField DataField="BlockName" HeaderText="Block Name" />
<asp:BoundField DataField="DistrictName" HeaderText="District Name" />
<asp:BoundField DataField="DepartmentName" HeaderText="Department Name" />
<asp:BoundField DataField="OfficerName" HeaderText="Officer Name" ItemStyle-Width="85" />
<asp:BoundField DataField="ServiceName" HeaderText="Service Name" ItemStyle-Width="120" />
<HeaderStyle CssClass="" />

</td>
</tr>


on aspx.cs page


protected void gvstatus_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "ShiftApplication")
{

Response.Redirect("ShiftApplication.aspx?applicantid=" + gvstatus.DataKeys[Convert.ToInt32(e.CommandArgument)].Value.ToString());


}
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900