如何使链接按钮消失并且在页面刷新时它不会显示该链接按钮 [英] how to make link button disappear and on page refresh it wont show that link button

查看:75
本文介绍了如何使链接按钮消失并且在页面刷新时它不会显示该链接按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的应用程序中,当我单击链接按钮时,我有5个链接按钮,它显示4个文本框和一个按钮,在输入文本框后,单击按钮,相应的链接按钮应消失,并且在刷新页面时不出现. "h2_lin">解决方案

在页面加载事件中使用IsPostback方法


 如果(!ispostback)
{
    // 您想要的代码
} 



它将以易于使用的语言检查页面刷新.或用技术语言
它将检查回发

放置断点并检查调试器何时进入if循环.


逻辑上可以执行


如果它是HTML控件,则制作一个cookie来存储信息
假设您的Div的名字是容器"
每当您想更改链接的可见性时,请编写HTML并将其保存到Cookie中

和页面加载


 onload ="MakeHTML();" 



 功能 MakeHTML()
{
 var 值= getCookie("  );
文档 .getElementById(' 容器') .innerHTML = -Values; // 来自Cookie 

} 


Hi

In my application i have 5 link buttons when i click on link button it displays 4 text boxes and one button and after inputing text boxes click on the button the appropriate linkbutton should disappear and it doesnt appear when i refresh the page.

解决方案

use IsPostback Method in page load event


if(!ispostback)
{
    //code u want
}



it will chek for the page refresh in easy language. or in technical language
it will check for postback

put breakpoint and check when your debugger goes into if loop..


Logically if You Can Do


Make a cookie to store information if it is HTML Control
That Suppose Your Div''s Name is "Container"
Whene Ever You Want To Change Visibility of Links Write HTML And Save It To Cookie

and On Page Load


onload="MakeHTML();"



function MakeHTML()
{
var Values=getCookie("HTML");
document.getElementById('Container').innerHTML=-Values;// From Cookie

}


这篇关于如何使链接按钮消失并且在页面刷新时它不会显示该链接按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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