简体   繁体   中英

How can i check if a checkbox is checked on a different asp page?

Basically i've got a settings page, and when you check the checkbox, it should hide certain topics on another page... How would i go about checking whether the checkbox is checked? Just need ideas on how to approach it.

(ASP and C#)

Thanks,

Becki

asp.net c# is checkbox checked?

Specify event for Button Click

<asp:Button ID="PublishButton" runat="server" Text="Save" onclick="PublishButton_Click" />

Just you can store the return value ie true or false in a session variable. So that every page can know that whethere the particular check box is checked or not. With this you can automate your code. I haven't tried it but it may work i guess. ie.

`if(checkbox.checked) session["variablename"]=true;// u have to decide else {

// false statement
} `

Hence this variable session["variablename"] can be accessible in that particular user session about 20mins.

You can check your setting by ajax call in time periods.

To do this :

  1. Settings page changes value from 0 to 1 in your database.
  2. Your pages should have jQuery ajax calls to get the latest value of your setting and apply it.

I hope it help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM