TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Riddhi Valecha
444
3.3k
412.7k
confirmation alert from code-behind (in If- Condition)
May 11 2016 4:55 AM
Hi all,<br /><br />I need to put an alert from code-behind on certain conditions.<br /><br />Please help me out -<br /><br />My aspx page and aspx.cs code are as follows -<br /><br /><br /> <asp:GridView ID="grdEmployeeDetails" runat="server" AutoGenerateColumns="false" Width="100%"><br /> <Columns><br /> <asp:TemplateField><br /> <HeaderTemplate><br /> <asp:CheckBox ID="chkHeader" runat="server" /><br /> </HeaderTemplate><br /> <ItemTemplate><br /> <asp:CheckBox ID="chkRow" runat="server" /><br /> </ItemTemplate><br /> </asp:TemplateField> <br /> <asp:BoundField DataField="Employee Name" HeaderText="Name" /><br /> <asp:BoundField DataField="Salary" HeaderText="Salary" " /><br /> <asp:BoundField DataField="Dept" HeaderText="Department" /><br /> <asp:BoundField DataField="Desig" HeaderText="Designation /><br /> </Columns><br /> <HeaderStyle Width="60px" Height="50px" /><br /> <RowStyle Width="200px" /><br /> </asp:GridView><br /><br /> <div><br /> <asp:Button ID="btnYes" runat="server" Text="yes" <br /> OnClick="btnYes_Click" /><br /> &nbsp;<br /> <asp:Button ID="btnNot" runat="server" Text="No"<br /> OnClick="btnNo_Click" /><br /> </div><br />-------------<br />aspx.cs -<br />btnYes_ClickEvent -<br />{<br /> Int32 totalCount = grdGetAsset.Rows.Cast<GridViewRow>().Count(r => ((CheckBox)r.FindControl("chkRow")).Checked);<br />if (totalCount > 0) <br />{<br /> string message = "Do you want to Submit?";<br /> System.Text.StringBuilder sb = new System.Text.StringBuilder();<br /> sb.Append("return confirm('");<br /> sb.Append(message);<br /> sb.Append("');");<br /> ClientScript.RegisterOnSubmitStatement(this.GetType(), "alert", sb.ToString());<br /> <br /> // here if user clicks "Yes" , then proceed further. Else No<br /> // How to check which button user have clicked ??<br />}<br /><br /><br /><div>} </div><div>--</div><div>Logic is - </div><div>1. System will check how many rows are selected (checkbox in gridview).</div><div>2. If number of rows selected is more than zero ; then the user will click on "Yes" button</div><div>3. On "Yes" button click - the system will ask -"Are you sure these are correct details" ?</div><div>4. Check if user have clicked on "OK" or "Cancel" button. If "OK" - proceed with update query. If "Cancel" - do nothing.</div><div>-----</div><div>Please guide ... its urgent,</div>
Reply
Answers (
3
)
How to use openxml for ppt export
AutoMapper Version Used : 3.3.10