"reload page"

N

NuB

I have a C# web form that allows the user to perform a search if all the
required fields are filled in, which works fine, my issue is if a user does
a sucessfull search then enters in data and misses a field they get a
message "field Name is missing" the result grid remains, how can I have the
grid not shown from the prior successful search if the users gets a
validation error for missing a required field or of no records are found?
 
A

Alvin Bruney - ASP.NET MVP

you can rebind it to a null value. that has the effect of hiding the grid.
or you can simply hide the grid (that doesn't necesarilly flush it though)

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
N

NuB

where would I do that?
I have something like this

on my button click
if (Page.IsValid)
{
grid.datasource = datasetname
grid.databind
}
else
{
grid.visible = false;
}


and that does not hide the grid. I also tried it in the page load event as
well. if Page.IsPostBack())

Alvin Bruney - ASP.NET MVP said:
you can rebind it to a null value. that has the effect of hiding the grid.
or you can simply hide the grid (that doesn't necesarilly flush it though)

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



NuB said:
I have a C# web form that allows the user to perform a search if all the
required fields are filled in, which works fine, my issue is if a user does
a sucessfull search then enters in data and misses a field they get a
message "field Name is missing" the result grid remains, how can I have the
grid not shown from the prior successful search if the users gets a
validation error for missing a required field or of no records are found?
 
A

Alvin Bruney - ASP.NET MVP

if (Page.IsValid)
{
grid.datasource = datasetname
grid.databind
}
else
{
grid.datasource = null;
grid.databind
}


--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



NuB said:
where would I do that?
I have something like this

on my button click
if (Page.IsValid)
{
grid.datasource = datasetname
grid.databind
}
else
{
grid.visible = false;
}


and that does not hide the grid. I also tried it in the page load event as
well. if Page.IsPostBack())

Alvin Bruney - ASP.NET MVP said:
you can rebind it to a null value. that has the effect of hiding the grid.
or you can simply hide the grid (that doesn't necesarilly flush it though)

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



NuB said:
I have a C# web form that allows the user to perform a search if all the
required fields are filled in, which works fine, my issue is if a user does
a sucessfull search then enters in data and misses a field they get a
message "field Name is missing" the result grid remains, how can I have the
grid not shown from the prior successful search if the users gets a
validation error for missing a required field or of no records are found?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top