Wednesday, March 21, 2012

Passing variables in .vb page_load event to .aspx file

Hello.
In my page_load event of my web form i check against a database to see if a particular record exists and return a boolean.
How do i get my aspx to check that boolean to determine what to display on the screen.?I would have something like:


// pseudo code

page_load()
{
// get from database

bool doesExist = databasecall();

if (doesExist)
continueSuccessfulDraw();
else
continueUnsuccessfulDraw();
}

Does that help?
You can also do this from within the method that handles the page_load event. One option would be to put a Placeholder control on your .aspx page in the location that you'd want to put whatever it is that is dependent on the boolean you are checking -- and then load the specific controls used for display into the Placeholder.
u need to use web controls
based on the value from the database you can set the visible property true/false

can you give some more details like exactly what you want to display?

0 comments:

Post a Comment