链接按钮属性添加疑问。[gridview刷新] [英] link button attribute add doubt.[gridview refresh]

查看:109
本文介绍了链接按钮属性添加疑问。[gridview刷新]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两页。



1)第一页有一个链接按钮...导航到下一页

2)一旦我点击第一页上的链接按钮...导航到第二页[它实际上是一个模态弹出键入一个separte窗口]。我在网页的第二页中插入此页面中的记录。当我关闭这个窗口,,,,并再次点击第一页上的链接按钮,,,我发现网格中没有记录,,,

但是当我再次运行我的代码时数据在那里,,,,



第一页代码:



i have two pages.

1)1st page where a link button is there...that navigates to next page
2)once i click on link button on first page...navigate to second page[its actually a modal pop up type a separte window]. I insert records in this page in 2nd page in the grid. When i close this window,,,, and again i click on link button on first page,,,i find no records there in the grid,,,
but when i run again my code the data is there,,,,

the first page code:

protected void gridShuttleAdmin_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //onmouse over and mouse out on the grid color changes
            e.Row.Attributes.Add("onmouseover", "this.previous_color=this.style.backgroundColor;this.style.backgroundColor='PaleGreen'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.previous_color;");

            Label lbltrip = (Label)e.Row.FindControl("lbltrip");
            if (lbltrip != null)
            {
                Label lblshuttledetailname = (Label)e.Row.FindControl("lblshuttledetailname");
                Label lblshuttlefacilityid = (Label)e.Row.FindControl("lblshuttlefacilityid");
                Label lblfacilityid = (Label)e.Row.FindControl("lblfacilityid");
                LinkButton lbtn = (LinkButton)e.Row.FindControl("lnkviewID");
                lbtn.Attributes.Add("onClick", "var sFeatures='dialogHeight: 700px;dialogWidth: 1000px;'; window.showModalDialog('Shuttle_StopDetails.aspx?shuttlefacilityid=" + lblshuttlefacilityid.Text + "&facility =" + lblfacilityid.Text + "&Trip = " + lbltrip.Text + "','',sFeatures);window.document.forms[0].submit();");
                 
               
            }
        }      
    }

/* lbtn.Attributes.Add("onClick", "var sFeatures='dialogHeight: 700px;dialogWidth: 1000px;'; window.showModalDialog('Shuttle_StopDetails.aspx?shuttlefacilityid=" + lblshuttlefacilityid.Text + "&facility =" + lblfacilityid.Text + "&Trip = " + lbltrip.Text + "','',sFeatures);window.document.forms[0].submit();");


here i m navigating to next page passing the parameters as query string
*/





/ *有很多疑点......这里还有一个疑问('Shuttle_StopDetails.aspx?shuttlefacilityid =+ lblshuttlefacilityid.Text +& facility =+ lblfacilityid.Text + & Trip =+ lbltrip.Text +','',sFeatures); window.document.forms [0] .submit(););



这里只有我能够获取的第一个参数,,,,在下一页,,,我无法获取其他两个参数,,,我做错了什么



trip_num = Request.QueryString [Trip]; //这里我得空了



shuttlefacility_id = Request.QueryString [shuttlefacilityid]; / /这里我能够获取数据

* /



/*lot of doubts are there....one more doubt over here is ('Shuttle_StopDetails.aspx?shuttlefacilityid=" + lblshuttlefacilityid.Text + "&facility =" + lblfacilityid.Text + "&Trip = " + lbltrip.Text + "','',sFeatures);window.document.forms[0].submit();");

here only the first parameter i am able to fetch,,,,in the next page,,,i m unable to fetch the other two parameters,,,am i doing anything wrong

trip_num = Request.QueryString["Trip"]; //here i am getting null

shuttlefacility_id = Request.QueryString["shuttlefacilityid"];//here i am able to fetch the data
*/

推荐答案

/ *有很多疑点......还有一个疑问在这里是('Shuttle_StopDetails.aspx?shuttlefacilityid =+ lblshuttlefacilityid.Text +&facility =+ lblfacilityid.Text +&Trip =+ lbltrip.Text +','',sFeatures); window.document.forms [0] .submit(););



这里只有我能够获取的第一个参数,,,,在下一页,,,我无法获取其他两个参数,,,我做错了什么



trip_num = Request.QueryString [Trip]; //这里我得空了



shuttlefacility_id = Request.QueryString [shuttlefacilityid]; //这里我可以获取数据

* /



我自己已经解决了这个问题...



实际上还有空格&Trip =......它应该是&Trip =





............但第一部分网格刷新正在等待.............................
/*lot of doubts are there....one more doubt over here is ('Shuttle_StopDetails.aspx?shuttlefacilityid=" + lblshuttlefacilityid.Text + "&facility =" + lblfacilityid.Text + "&Trip = " + lbltrip.Text + "','',sFeatures);window.document.forms[0].submit();");

here only the first parameter i am able to fetch,,,,in the next page,,,i m unable to fetch the other two parameters,,,am i doing anything wrong

trip_num = Request.QueryString["Trip"]; //here i am getting null

shuttlefacility_id = Request.QueryString["shuttlefacilityid"];//here i am able to fetch the data
*/

I have solved this part myself...

actually there was space after "&Trip = "...it should be "&Trip ="


............but the first part grid refresh is pending.............................


这篇关于链接按钮属性添加疑问。[gridview刷新]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆