我的运行页面如下 我的Gridview页面代码如下 我的Gridview代码如下
My Run page as follows My Gridview page code as follows My Gridview code as follows
protected void Page_Load(object sender, EventArgs e) { using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["himtConnectionString"].ConnectionString)) using (var cmd = new SqlCommand("OH_PKG_DATE_COMBINATION '" + Session["compkgid"].ToString().Trim() + "'", con)) con.Open(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); GridView1.DataSource = dt; GridView1.DataBind(); }Lnk按钮代码如下
Lnk button code as follows
protect void Link_click(object sender,eventargs e) { popup.show(); }来自会话变量数据的链接按钮将在gridview中传递弹出窗口。 链接按钮(查看可用批次日期) 当我点击查看可用时链接按钮弹出的批日期将显示。 弹出如下 显示日期(按钮) 当我点击弹出窗口中的显示日期按钮时,将显示Gridview日期。 然后我有一个名为Hide Button的按钮。 当我点击隐藏按钮时我想清除会话变量。 i想要在弹出窗口中单击隐藏按钮时清除会话[compkgid] 值。 我该怎么办。
In Link button from the session variable data will be passed in gridview using the popup. Link Button (To View Available Batch Date) When i click the View Available Batch date in Link button Pop up will be shown. POP up as follows Show date (Button) When i click the Show date button in popup then in Gridview date will be displayed. Then i have one button called Hide Button. When i click the hide button i want to clear the session variable. i want to clear Session["compkgid"] values when i click the hide button in popup. for that how can i do.
推荐答案处理按钮点击(警告的JavaScript?)并清除会话列表o f变量。 Handle the button click (alert of JavaScript?) and clear the value from the Session list of variables. Session["compkgid"] = null; // set it to null
主要的是你如何处理按钮点击,它是ASP.NET控件,它是JavaScript警告框还是什么?如果是ASP.NET控件,那么您可以在服务器端处理click事件并在其中添加此代码。否则,如果这是JavaScript按钮,则必须向服务器发送异步(ajax)请求以清除Session变量,或者您可以使用某个表单输入字段来存储该状态等。
The main thing is how would you handle the button click, is it ASP.NET Control, is it JavaScript alert box or what? If ASP.NET control, then you can handle the click event on the server-side and add this code in it. Otherwise, if this is JavaScript button then you must send asynchronous (ajax) request to server to clear the Session variable or you can use some form input field to store that state etc.
更多推荐
关闭弹出窗口时删除会话变量
发布评论