Showing posts with label page. Show all posts
Showing posts with label page. Show all posts

Saturday, March 31, 2012

SendUsing" configuration value is invalid.

hello every body

SendUsing" configuration value is invalid. this is error is on my forgotpassword.aspx page it is working very well on localhost after creating virtual directory

but when ever it is upload on server then give this types of error my code is given bellow--

Imports System.Configuration

Imports System.Web.Mail

If Email = txtEmail.TextThen

Dim MAILMSGAs MailMessage =New MailMessage()

MAILMSG.To = Email

MAILMSG.From ="jmorris@dotnet.itags.org.Onlinecatalog.com"

MAILMSG.Body ="Dear " + FName +" " + LName +"<br><br>"

MAILMSG.Body +="Here's your UserName and password:<br>"

MAILMSG.Body +="<b>UserName:</b> " + UserName +"<br><b>Password:</b> " + Password +""

MAILMSG.Body +="<br><br>Thanks,<br><br>"

MAILMSG.Body +="Onlinecatelog.com"

MAILMSG.Subject ="Account Password of Onlinecalalog "

MAILMSG.BodyFormat = MailFormat.Html

SmtpMail.Send(MAILMSG)

Else

Label3.Text ="Enter your proper E-Mail ID."

EndIf'-----------Send E-mail to New User ----------//

EndIf

so if any body have any solution regarding this then plz inform me as soon as its too urgent for me..................

thanks in advance


Running ASP.NET 1.1? Did you look atwww.systemwebmail.com?

Jeff

SEO URL Rewrite (vb.net)

Hi,

We have a list of several dynamic pages that are called like "page.aspx?id=12" etc. We want to change this so its like "page12.aspx". I've read that this can be done in global.asax by application_begin but we can't seem to get it working.

Help appreciated.

Thanks,Check outhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp for a good description of how to do this.

I've look into it pretty heavy too and found this method much much more flexible

http://weblogs.asp.net/scottgu/archive/2006/01/18/435870.aspx

seo question

Hi

can anyone tell me - if i have content stored in a database and its being displayed in GRIDVIEW on front page of website (like news) - is that content being picked up by bots/search engines etc?


cheers


Probably. :)

It will be read by any SEO that spiders your site, since the spider reads rendered output. But, if the user needs to select parameters to display the content, such as in a search, it may not get spidered.

SEO doesn't depend on ASP.NET, so you won't find much on this site to help you. Try Google, there's a ton of information out there.

Jeff


cheers Jeff

Separate by comma

Hi,

I have a datalist on my page to select data from a table

I want to access it with code to insert its values to another table. Te datalist will return more than one row, so i'd like the values seperated by commas when they are inserted to the new table (all in one row).

I have looked around and it seems that I need to do something to the select statement of the other control first - I have got:

SELECT [Usersname]= COALESCE (Usersname + ' , ' , ' ')
FROM [Transactions] WHERE ([Itemid] = @dotnet.itags.org.Itemid)

Does that look right?

And when I have selected these values, how do I insert them in the same format (separated by commas) ?:

DataView dv = SqlDataSource2.Select(DataSourceSelectArguments.Empty) as DataView;
string receivername = dv[0]["receivername"].ToString();
command.Parameters.AddWithValue("@dotnet.itags.org.recievername", receivername);

Would that still work?

Thanks,

Jon

pls help!!


You can pass the value (comma separated value) to a stored procedure as a parameter.

Within the procedure you can insert the data into the table. Before inserting the data into the table we have to split it by comma and then we have to place in a temporary table.

Now we have to extract the data from temp table to actual table.

There is a function called "split" is available to split the data and it will return the data as a table. You can use the same function to insert into your table.

You can get this function at of this URL:http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50648

http://vadivel.blogspot.com/2006/05/split-function-in-sql-server-method-1.html

Hope this helps you.

Separate data by comma

Hi,

I have a datalist on my page and I want to access it with code to insert its values, seperated by commas.

I have looked around and it seems that I need to do something to the select statement of the other control first - I have got:

SELECT [Usersname]= COALESCE (Usersname + ' , ' , ' ')
FROM [Transactions] WHERE ([Itemid] = @dotnet.itags.org.Itemid)

Does that look right?

And when I have selected these values, how do I insert them in the same format (separated by commas) ?:

DataView dv = SqlDataSource2.Select(DataSourceSelectArguments.Empty) as DataView;
string receivername = dv[0]["receivername"].ToString();
command.Parameters.AddWithValue("@dotnet.itags.org.recievername", receivername);

Would that still work?

Thanks,

Jon

pls help!


If I m not wrong, I understand from your question that you need to enter multiple rows in database.

You can refer

http://zirmandli.wordpress.com/2007/09/22/data-access-application-block-gets-batch-update-functionality-in-enterprise-library-30/

I hope this will help u....


Hi,

No, I didnt explain well enough. I will repost.

Thanks anyway

Jon

separate HTML from codebehind for user control page

I have a site that uses header.ascx as a user control for the Top Menu. I'm trying (to do it the right way) to separate the HTML code from the codebehind but I'm having a difficult time w/ it... I looked at some articles on codebehinds but most of them are event driven like if you click on a button and some event happens... but for my page, I just want to display a menu at a specific location when the form loads... I guess I have to put it in a function and then call it from my main page? But I'm not sure how??
============================
header.ascx
============================
<%@dotnet.itags.org. Control Language="vb" AutoEventWireup="false" Codebehind="header.ascx.vb" Inherits="intranet.header" %>

============================
header.ascx.vb
============================
PublicClass nav_header
Inherits System.Web.UI.UserControl
Public strPageTitleAsString
Public strTopMenu1AsString

PrivateSub Page_Load(ByVal senderAs System.Object,ByVal eAs System.EventArgs)HandlesMyBase.Load

Response.Write("<title>" & strPageTitle & "</title>")
Response.Write("</head><body>")
Response.Write("<table><tr><td>test...</td></tr>")
Response.Write("<tr><td><table><tr>")

Dim strTopMenu2()AsString
SelectCase strTopMenu1

Case "Header 1"
strTopMenu=NewString() {"Corporate_CatHeader1", "../Corporate/header1.aspx", "Corporate_CatHeader2", "../Corporate/header2.aspx"}
Case "Header 2"
strTopMenu =NewString() {"Practices_CatHeader1", "../Practices/header1.aspx", "Practices_CatHeader2", "../Practices/header2.aspx"}
Case "Header 3"
strTopMenu =NewString() {"WebMail_CatHeader1", "../WebMail/header1.aspx", "WebMail_CatHeader2", "../WebMail/header2.aspx"}
CaseElse' no menu requested, so include a blank spacer

ExitSub
EndSelect

Dim intTopMenu2ItemAsInteger
Dim intSelectedTopMenu1AsInteger
Dim iAsInteger

intSelectedTopMenu1 = (intTopMenu2Item - 1) * 2
For intTopMenu2Item = 0To UBound(strTopMenu2)Step 2
Response.Write("<td> <A href='" & strTopMenu2(intTopMenu2Item + 1) & "'>" & strTopMenu2(intTopMenu2Item) & "</a>")
Response.Write(" | </td>" & vbCrLf)

Next

Response.Write("</tr></table>")
Response.Write("</td></tr></table>")

EndSub

EndClass

In the inherits atribute of your page ensure it matches your class name. In this case your class name is nav_header but the inherits is intranet.header. For starters if you are not using Visual Studio then the intranet part is not necessary unless you wish to encompass the class in a namespace. The quick solution is to change inherits to header and the class name to header.
Sorry I mistyped some of the names... here's a short version.. please help..
===============
header.ascx
===============
<%@. Control Language="vb" AutoEventWireup="false" Codebehind="header.ascx.vb" Inherits="myapp.header" %>
<table><tr>
<td>
How can I display the test() here??
</td>
</tr></table>
===============
header.ascx.vb
===============
Public Class header
Inherits System.Web.UI.UserControl
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub test()
Response.Write("test")
End Sub
End Class
Have you tried inherits="header" instead of myapp.header?

Separate dynamic controls with a "<br>"

I'm adding controls to my page in code and needed <br> between the controls to put them on new lines. I just want to write <br>'s to the page without using the HtmlAnchor control. Is there a better way than this?

Label l1 = new Label();
Label l2 = new Label();
Label l3 = new Label();

HtmlAnchor an1 = new HtmlAnchor();
HtmlAnchor an2 = new HtmlAnchor();

l1.Text = "Label1";
l2.Text = "Label2";
l3.Text = "Label3";

an1.InnerHtml = an2.InnerHtml = "<br>";

Page.Controls.Add(l1);
Page.Controls.Add(an1);
Page.Controls.Add(l2);
Page.Controls.Add(an2);
Page.Controls.Add(l3);You could encapsulate the controls inside User Controls, and simply have a <br> appended in the HTML there.
You could encapsulate the controls inside User Controls, and simply have a <br> appended in the HTML there.
OK now I have the controls in a user control so how can I append the HTML? I still couldn't think of a better way than what I already have.
Just right click and go into the HTML Source for the user control, and put <br> at the bottom of it :)
But the <br> needs to be loaded dynamically between every element inside the user control. I thought I could just use some sort of HTML writer to write between the elements on the page.
Create a Generic Html Control HtmlControl namespace set it up as a <br> and add it between the controls.

If it needs to be added for every added control override the add/added control member and do it there.
Take the time to scroll down your toolbox until you find the Literal Control. That control is rarely seen because you normally have to scroll down to it. You see, it literally outputs what you put into it. So, you can put html into it, and it spits it out into the response stream just as you had put it in the .Text property. This is useful if you want to display html content from a database, or do exactly what you want to do. Example:

Label l1 = new Label();
Label l2 = new Label();
Label l3 = new Label();

LiteralControl lc1= new LiteralControl ();
LiteralControl lc2= new LiteralControl ();

l1.Text = "Label1";
l2.Text = "Label2";
l3.Text = "Label3";

lc1.Text= lc2.Text= "<br>";

Page.Controls.Add(l1);
Page.Controls.Add(lc1);
Page.Controls.Add(l2);
Page.Controls.Add(lc2);
Page.Controls.Add(l3);

Thursday, March 29, 2012

Separate vb page?

Question, in two parts, I have separated my vb code from the asp page. But, I have noticed on many code samples this is not 'normally' being done. I have also noticed that it is easier to reference controls if you write your scripts on an asp page. If you separate your vb code from an asp page what is the best way to reference your controls and their properties? Also, What is considered 'best practice'? Should you separate them or not?

Thanks in advanceMarvin

As far as using code behind, I don't think that it is a best practice but a personal choice. I personally like the code behind because it keeps all my code in one place and easier for me to referrance. When I need to add an even or sub, I just double click on either the object or page depending on what I want to do.

OK... what you want to be doing is usingCodeBehind. You can select this as an option when you create your page.

Whether you use codebehind or have it on the page will makeno difference with regards to accessing your controls and their properties.

Many samples don't use code behind because it ismuch easier to post a sample that novice users can just paste into a page when you include the server-side script in the page.


Thank you both for your replies.

James, forgive me I am still new to all of this asp.net. When you say 'codebehind' do you mean... separating the vb from the ASP page? I am assuming this is correct. right?


Codebehind separates the markup (asp to you) and the source code (vb/c#) but maintains a link between them.

See this...http://support.microsoft.com/kb/303247

Separating form elements on aspx page

I have a series of controls (a few buttons that clears content,
inserts data into dbase, logs out a user session) that need to work
independently of each other, but I cannot put all these controls into
more than one form tag, as asp.net pages are not allowed to have more
than one < form runat: server> tag. . If i try to logout of a session
on the page with this:
'''
<script language="VB" runat="server">
Sub logout(Sender As Object, e As EventArgs)
Session.Clear()
Response.Redirect("admin-login.aspx")
End Sub
</script>
<asp:Button id="button4" onClick="logout" Text="Logout"
class="inputSubmit" runat="server" />
'''

...it tries to post my info again from the insert textbox objects
before the logout button.

??
chumleyiframes?

Eliyahu

"Chumley the Walrus" <springb2k@.yahoo.com> wrote in message
news:1ef65641.0408030802.1c912932@.posting.google.c om...
> I have a series of controls (a few buttons that clears content,
> inserts data into dbase, logs out a user session) that need to work
> independently of each other, but I cannot put all these controls into
> more than one form tag, as asp.net pages are not allowed to have more
> than one < form runat: server> tag. . If i try to logout of a session
> on the page with this:
> '''
> <script language="VB" runat="server">
> Sub logout(Sender As Object, e As EventArgs)
> Session.Clear()
> Response.Redirect("admin-login.aspx")
> End Sub
> </script>
> <asp:Button id="button4" onClick="logout" Text="Logout"
> class="inputSubmit" runat="server" />
> '''
> ..it tries to post my info again from the insert textbox objects
> before the logout button.
> ??
> chumley

Separating form elements on aspx page

I have a series of controls (a few buttons that clears content,
inserts data into dbase, logs out a user session) that need to work
independently of each other, but I cannot put all these controls into
more than one form tag, as asp.net pages are not allowed to have more
than one < form runat: server> tag. . If i try to logout of a session
on the page with this:
'''
<script language="VB" runat="server">
Sub logout(Sender As Object, e As EventArgs)
Session.Clear()
Response.Redirect("admin-login.aspx")
End Sub
</script>
<asp:Button id="button4" onClick="logout" Text="Logout"
class="inputSubmit" runat="server" />
'''
..it tries to post my info again from the insert textbox objects
before the logout button.
'
chumleyiframes?
Eliyahu
"Chumley the Walrus" <springb2k@.yahoo.com> wrote in message
news:1ef65641.0408030802.1c912932@.posting.google.com...
> I have a series of controls (a few buttons that clears content,
> inserts data into dbase, logs out a user session) that need to work
> independently of each other, but I cannot put all these controls into
> more than one form tag, as asp.net pages are not allowed to have more
> than one < form runat: server> tag. . If i try to logout of a session
> on the page with this:
> '''
> <script language="VB" runat="server">
> Sub logout(Sender As Object, e As EventArgs)
> Session.Clear()
> Response.Redirect("admin-login.aspx")
> End Sub
> </script>
> <asp:Button id="button4" onClick="logout" Text="Logout"
> class="inputSubmit" runat="server" />
> '''
> ..it tries to post my info again from the insert textbox objects
> before the logout button.
> '
> chumley

Separating my VB classes into different files

Here's my scenario: I have a page default.aspx with the header directive
<%@dotnet.itags.org. Page aspcompat=true Language="VB" Debug="true" Inherits="forms" src="http://pics.10026.com/?src=forms.vb"%>
So I have the file forms.vb that contains the class "Forms", and that class references some custom controls I've made such as "FormPageControl" and it works just fine when I have FormPageControl defined in forms.vb, which I can do, but I want to be able to give it its own vb file, so I made a file called "FormPageControl.vb" and moved the class into that file. But how do I link forms.vb to FormPageControl.vb (like in C++ I would use the line: #include "FormPageControl.h" is there something simmilar in VB.NET so that the Just in Time compiler knows to look in FormPageControl.vb for the class named FormPageControl?

Is FormPageControl a user control? If so just use the @.Controltag to declare it on the aspx page and put it in a separate ascx file.
http://www.ondotnet.com/pub/a/dotnet/excerpt/progaspdotnet_14/index1.html

FormPageControl is a vb class that inherits Repeater. There is no ascx file associated with it
What's the error you are getting when you try to compile? Make sure you have the appropriate Imports statement.

Seperate Content from Code

After nearing completion of my first full .Net web application I am left with a page consisitng of around 600 lines of code, approximately split half and half between VB script and HTML page content.

Can anyone point me in the right direction of the best way to encapsulate the VB code into its own seperate file and then rerefence this from the form in the HTML page?

Hi,

you could place the code into separate aspx.vb file into its own class deriving form System.Web.UI.Page. Then putting the aspx to inherit from this code-behind class (with Inherits directive) would work.

Say you have files

page1.aspx (important ones are CodeFile and Inherits attributes)

<%@. Page Language="VB" AutoEventWireup="false" CodeFile="page1.aspx.vb" Inherits="page1" %>

...

page1.aspx.vb

Partial Class page1

Inherits System.Web.UI.Page

End Class

When you could put code into aspx.vb file into the class.

More information :http://www.asp.net/QuickStart/aspnet/doc/pages/codebehind.aspx

Of course if have code & logic which is such that it's common to more than one form, you might want to consider having a separate component (class library or in App_Code) where you could centralize logic that is needed in multiple places.


Thanks joteke, I think I'm slowly getting there.

So the .aspx file inherits the class that you create in the aspx.vb file ?

Then within that class you simply insert all the code that was previously in the <script> section at the top of the .aspx file?

What does the'AutoEventWireup' attribute do?


Also, do i need to import the namespaces in the aspx file or the aspx.vb file ?

duncanhall:

So the .aspx file inherits the class that you create in the aspx.vb file ?

Yes. Basically with partial classes in ASP.NET 2.0 (when using CodeFile attribute) a second partial class is created. This class contains control declarations for controls residing on aspx (removes the need for you to declare them on aspx.vb as you had to do with ASP.NEt v1.x).

These two partial classes are merged when compilation occurs and are used as base class for class which is created when the actual aspx is parsed and compiled (yes, basically the aspx itself)

duncanhall:



Then within that class you simply insert all the code that was previously in the <script> section at the top of the .aspx file?

Yes, note that the code-behind class is now equally part of your page.

duncanhall:


What does the'AutoEventWireup' attribute do?

It indicates whether Page's event are autowired. If enabled, it means that you have a method which matches Page_[EventName] or [ControlID]_[EventName] name so that method would automatically be assigned as event handler for the correspondng event of P?ager or the Control. Normally these event methods need to be wired explicitly.

See:ASP.NET Web Server Control Event Model


If code is in code-behind, then you import in code-behind.
Thanks a lot joteke, everything seems to make sense now, and my first app is pretty much finished!

Seperate Auth for single page

Can you specify a different authentication method ('none') for a single
page? I have the web.config designed for 'Forms' auth, but I have one page
that I want outside the auth method, without putting it into a seperate
folder with it's own web.config.

Thanks

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.comYou can specify some pages to require login, and others to not require login
via your web.config file by using the <location> tag.

Here is an example with sample code that you can download and play with.
http://www.dotnetbips.com/displayarticle.aspx?id=117

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Curt_C [MVP]" <software_AT_darkfalz.com> wrote in message
news:%23GKNgVP4DHA.1700@.TK2MSFTNGP11.phx.gbl...
> Can you specify a different authentication method ('none') for a single
> page? I have the web.config designed for 'Forms' auth, but I have one page
> that I want outside the auth method, without putting it into a seperate
> folder with it's own web.config.
> Thanks
> --
> Curt Christianson
> Owner/Lead Developer, DF-Software
> www.Darkfalz.com
Yes - see the <location> element of web.config.

example:

<location path="Logon.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location
HTH,

--
Scott
http://www.OdeToCode.com

On Thu, 22 Jan 2004 08:40:56 -0600, "Curt_C [MVP]"
<software_AT_darkfalz.com> wrote:

>Can you specify a different authentication method ('none') for a single
>page? I have the web.config designed for 'Forms' auth, but I have one page
>that I want outside the auth method, without putting it into a seperate
>folder with it's own web.config.
>Thanks

Seperate folder page Inheritance issue

Hi,
I have a page "Project Folder\Customers\Products.aspx" which I want to inherit from another page "Project Folder\Product.aspx". As mentioned both files are in seperate folder.
In the customer specific Product.aspx page I want to use some code of the main product page. How can I do this? How can I inherit from page in a different folder?
Thanks in advance.

(if this is 2005) the code files should be in the app_code folder then. The security model in 2005 makes it difficult to get at the other files.
I don't think you can actually inherit from an other page (aspx). You have to create a custom control (ascx) and put this control in each of your page. If you want to inherit the code, juste create a class which inherits from Page and your pages just need to inherit from this class.
Yes. I am using .net 2.0 and VS 2005. Sorry i didn't mentioned that.
or use master pages...that's what they are there for :}

Seperate validation for seperate user controls on same page

asp.net 2.0
I have a page with a tab control on it. Each tab has a different user
control on it. each user control is used for different data entry (like
separate data entry forms) and has its own validation controls and
validation summary control.

When I'm on the first tab, it uses all the validation control on the other
tab as well. How can I keep all the logic for the validation separate for
each UC as if they were their own pages?

Thanks.

--
moondaddy@dotnet.itags.org.noemail.noemailWhen I'm on the first tab, it uses all the validation control on the other

Quote:

Originally Posted by

tab as well. How can I keep all the logic for the validation separate for
each UC as if they were their own pages?


Difficult to do... not sure but you may want to look into "ValidationGroup".

--
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
-------------
Hi moondaddy,

As for the validation separation question you posted here, I've also found
your another thread "Validation Groups". I've posted some suggestion about
use the ASP.NET 2.0 Validation Group feature there. Please feel free to
followup there if you have any further questions on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Seperate validation for seperate user controls on same page

asp.net 2.0
I have a page with a tab control on it. Each tab has a different user
control on it. each user control is used for different data entry (like
separate data entry forms) and has its own validation controls and
validation summary control.
When I'm on the first tab, it uses all the validation control on the other
tab as well. How can I keep all the logic for the validation separate for
each UC as if they were their own pages?
Thanks.
moondaddy@dotnet.itags.org.noemail.noemail> When I'm on the first tab, it uses all the validation control on the other
> tab as well. How can I keep all the logic for the validation separate for
> each UC as if they were their own pages?
Difficult to do... not sure but you may want to look into "ValidationGroup".
Happy Hacking,
Gaurav Vaish | www.mastergaurav.com
www.edujinionline.com
http://eduzine.edujinionline.com
---
Hi moondaddy,
As for the validation separation question you posted here, I've also found
your another thread "Validation Groups". I've posted some suggestion about
use the ASP.NET 2.0 Validation Group feature there. Please feel free to
followup there if you have any further questions on this.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

sequence in which page is loaded

I want to know the sequence of functions that are invoked when a page is loaded like page_init is always invoked before page_load and so on ... i need the exact sequence of all the events of a page that if i put code in each event which is going to work in which sequence.

Regards,

Harris Moinno one has even viewed my post yet ...... :(((((

Anyways i have found the result myself might be helpful for someone out there as well .... so posting it here

SEQUENCE OF THE PAGE EVENTS IN WHICH THEY ARE FIRED

1. Initialize:
==========
Initialize settings needed during the lifetime of the incoming Web
request.

2. Load view state:
================
At the end of this phase, the ViewState property of a control is
automatically populated as described in Maintaining State in a Control.
A control can override the default implementation of the LoadViewState
method to customize state restoration.

3.Process postback data:
======================
Process postback data Process incoming form data and update properties
accordingly.

4. Load:
=======
Perform actions common to all requests, such as setting up a database
query. At this point, server controls in the tree are created
and initialized, the state is restored, and form controls reflect
client-side data.

5. Send postback change notifications:
=================================
Raise change events in response to state changes between the current and
previous postbacks.
Note Only controls that raise postback change events participate in this
phase.

6. Handle postback events:
========================
Handle the client-side event that caused the postback and raise appropriate
events on the server.


7. Prerender:
===========
Perform any updates before the output is rendered. Any changes made to the
state of the control in the prerender phase can
be saved, while changes made in the rendering phase are lost.

8. Save state:
============
The ViewState property of a control is automatically persisted to a string
object after this stage. This string object is sent to the
client and back as a hidden variable. For improving efficiency, a control
can override the SaveViewState method to modify the ViewState
property.

9. Render:
=========
Generate output to be rendered to the client.

10. Dispose:
===========
Perform any final cleanup before the control is torn down.

11. Unload:
==========
Perform any final cleanup before the control is torn down. Control authors
generally perform cleanup in Dispose and do not handle this event.

Sequence of events

Hi all,

I've got an aspx page with a Web user control and (among other things) a
submit button. When the form is submitted, the same page is to be served
back up, but with some items changed, mainly a panel visible that had not
been and a setting in the user control. The problem I'm having is figuring
out how to manipulate the flagging values as the submit's handler doesn't
fire until the page and controls' load methods. I'm a bit fuzzy on the
firing order of methods between objects, but am I better off moving such
code to the PreRender methods?

TIA,

JohnYour button click event handler should contain the code to flip the
visibility of the panel. The Page_Load code should only contain code that
should execute no matter what.

"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
Yes, moving the code to PreRender is a good idea. It is not always possible,
especially if what has been clicked affects databinding, but, if it is not a
case, go for it. You can't change event sequence.

Eliyahu

"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
Hi John,

I keep the following bookmark handy, when I need to work more closely with
the execution lifecycle:

http://msdn.microsoft.com/library/d...onLifecycle.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
> figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
Thanks, all! One problem down, 3.2 million to go <g>.

"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>

Sequence of events

Hi all,
I've got an aspx page with a Web user control and (among other things) a
submit button. When the form is submitted, the same page is to be served
back up, but with some items changed, mainly a panel visible that had not
been and a setting in the user control. The problem I'm having is figuring
out how to manipulate the flagging values as the submit's handler doesn't
fire until the page and controls' load methods. I'm a bit fuzzy on the
firing order of methods between objects, but am I better off moving such
code to the PreRender methods?
TIA,
JohnYour button click event handler should contain the code to flip the
visibility of the panel. The Page_Load code should only contain code that
should execute no matter what.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
>
Yes, moving the code to PreRender is a good idea. It is not always possible,
especially if what has been clicked affects databinding, but, if it is not a
case, go for it. You can't change event sequence.
Eliyahu
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
>
Hi John,
I keep the following bookmark handy, when I need to work more closely with
the execution lifecycle:
http://msdn.microsoft.com/library/d...onLifecycle.asp
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Neither a follower nor a lender be.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
> figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
>
Thanks, all! One problem down, 3.2 million to go <g>.
"John Spiegel" <jspiegel@.YETANOTHERSPAMHATERc-comld.com> wrote in message
news:OgWT8hZ8EHA.1452@.TK2MSFTNGP11.phx.gbl...
> Hi all,
> I've got an aspx page with a Web user control and (among other things) a
> submit button. When the form is submitted, the same page is to be served
> back up, but with some items changed, mainly a panel visible that had not
> been and a setting in the user control. The problem I'm having is
figuring
> out how to manipulate the flagging values as the submit's handler doesn't
> fire until the page and controls' load methods. I'm a bit fuzzy on the
> firing order of methods between objects, but am I better off moving such
> code to the PreRender methods?
> TIA,
> John
>
>

Monday, March 26, 2012

sequence of event fires when we run aspx page

Hi,

1. Can any body give me thr detail senario for sequence of events fires for asp.net.

like : Init , page_load , prerender , etc ....

2. Can any body tell me the detail senario for sequence of events fires when we use custom control in aspx page ?

3. Can any body tell me the detail senario for sequence if events fires when we use user control in aspx page ?

I really need some expert's comment here.

Thanks,
-ChintanGoogle is your friend. A simple search for "asp.net page load sequence" returned this:
Read Me