473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to build a dynamic page

Hy all

I've a little problem. I need to write a dynamic page that render
control according to validation status return from previous control
validation status.

To be clear, I've page that starts requesting some info, then user
press a button, and the same page should show the new field only if
validation returns true. But it sounds not so simple to do.

According to line-guide this is what happens in the order

Page_load - load the control
Validation_Handler - check for validity of content
Page_prerender - last chance to modify content

Validation_handler could be skipped if the submitting button (those
with causevalidation, has the property setted to false, but this mean
that I should perform the check manually).

In a first moment I think, move the control creation on the
page_prerender, but I see that there the addhandler routine, despite
valid for compilator, is still unusefull because it's ignored by the
server, so the dynamic button (at least those need to perform the
causevalidation) should always create on the load. This wasn't a
problem.
But in a second moment, when passing for the validation_handler I saw
that creating control on the render event, because control wasn't
created yet the page.isvalid after a page.validate still return always
true.

Then started my problem. I really don't know how to display dynamic
control according to page's validate status.

Any help? Unfortunately I'm so focused on my idea now, that I'm not
able to see the right solution. It's more then 4 hours that I get round
problem, but I'm so blind to don't show the way to solve it. And I
don't wanna to think it's impossible. It was possible - with some
escamotage - with old ASP ...

Thanks
Andrea

Nov 19 '05 #1
3 1696
Hello,
I would try to make the item invisible, and if page.IsValid is true, make
the "hidden" item visible.

It would be something like this:
---- on page.aspx
....
<asp:textbox id="validatedTextBox" runat="server" />
<asp:requiredfieldvalidator runat="server"
controltovalidate="validatedTextBox" />
<asp:button runat=server id="myButton">

<asp:textbox id="toBeShownLater" runat="server" visible="false" />
....
'---- on page.aspx.vb
....
private sub myButton_click(sender as Object, e as EventArgs) Handles
myButton.Click
if page.IsValid then
toBeShownLater.visible = true
End if
End sub
....

If you are to show many elements, you can enter them within an <asp:table>
and make the table invisible.

Should you have any question or comments, let me know.

Regards,
Cesar

"vodafone" wrote:
Hy all

I've a little problem. I need to write a dynamic page that render
control according to validation status return from previous control
validation status.

To be clear, I've page that starts requesting some info, then user
press a button, and the same page should show the new field only if
validation returns true. But it sounds not so simple to do.

According to line-guide this is what happens in the order

Page_load - load the control
Validation_Handler - check for validity of content
Page_prerender - last chance to modify content

Validation_handler could be skipped if the submitting button (those
with causevalidation, has the property setted to false, but this mean
that I should perform the check manually).

In a first moment I think, move the control creation on the
page_prerender, but I see that there the addhandler routine, despite
valid for compilator, is still unusefull because it's ignored by the
server, so the dynamic button (at least those need to perform the
causevalidation) should always create on the load. This wasn't a
problem.
But in a second moment, when passing for the validation_handler I saw
that creating control on the render event, because control wasn't
created yet the page.isvalid after a page.validate still return always
true.

Then started my problem. I really don't know how to display dynamic
control according to page's validate status.

Any help? Unfortunately I'm so focused on my idea now, that I'm not
able to see the right solution. It's more then 4 hours that I get round
problem, but I'm so blind to don't show the way to solve it. And I
don't wanna to think it's impossible. It was possible - with some
escamotage - with old ASP ...

Thanks
Andrea

Nov 19 '05 #2
> I would try to make the item invisible, and if page.IsValid is true, make
the "hidden" item visible.


This mean that all page should be built in one step. It doesn't sound very
nice. Better, because according to first user selection, fiels changes
completely from solution to solution (there are up to 64 possibility) and
for 10 of them there will be the chance that steps to finish grow up to 11
steps instead the normal two, the hiding solution won't be the easiest one.

Just to know. How do you normally use the validation? Just with a single
page step? Could you try to post a stupid sample of two nested page like I
need? or some usefull links.
I don't believe that it's impossible. I suppose then that could be more
convenient to buy the Plumb Components. It should avoid this kind of
problems. But as stupid as I can be, I don't wanna to think that MS
implemented this time-reduction solution for validation and inserted those
limit (that will overcome with 2.0) that annoy ASP.net programmer.

Sincerely
Andrea Moro
Nov 19 '05 #3
x

Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: pcgxk | last post by:
Due to some bugs in .NET SP1 which we are currently review with MS under separate cover, I am having to regress the patching levels of several of my desktops to rebuild and retest several versions...
0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
2
by: Julia | last post by:
Hi, Is it possible to add post build event to copy several fiels after all project have been compiled? I don't want to put it in one of the project post build event Thanks.
3
by: TPS | last post by:
Instead of using Hyperlinks and URL / Response.QueryString() parameters to pass state around in my app, I am using LinkButtons with a corresponding command event and command arguments. This page...
7
by: Rudy | last post by:
Hello All! After working in the television industry, moving to a developing career has been interesting to say the least. 3 years of developing with books, and the help of you fine folks on this...
1
by: | last post by:
I'm having a problem finding the cause for this problem. I have a solution in Visual Studio 2005 that contains two projects -- a Web Site and a Class Library. The web site references the class...
2
by: steven | last post by:
i've got approximately 30 web forms i need to build to allow users to input data that will eventually be captured to an XML doc. i've also got 30 XSD files. so far, i haven't come up with a reason...
25
by: pereges | last post by:
Hello, I'm trying to build a database driven website for a library management system. The database is stored on a remote server which all of my team mates can access. I've installed MySQL, PHP and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.