Problems wit events
by Norbeto Mesen » Fri, 10 Oct 2003 07:45:56 GMT
Hi, everybody
I have a problem with the events in a web page.
I have a botton with a method that should execute a method on mouse click
but for some reason (that I don't know) it is executing the page_Load before
the method call, WHY?
What I need is that the method be called before any event and If its
possible to cancel the Page_Load, or where else I can set this code in the
button. This is what I have. The Page_Load always gets fired when I click
onm btnBuscar. Any ideas.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If IsPostBack Then
End If
End Sub
Private Sub btnBuscar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnBuscar.Click
Dim condicion As String
condicion = ""
PrepareCondition(Page, condicion)
If condicion.Length <> 0 Then
condicion = " WHERE " & condicion.Substring(4)
End If
Session("tcWhere") = condicion
Response.Redirect("frmMansgrPoliza.aspx")
End Sub
Also I have another problem if i refresh the page with F5 function key, the
click event on the botton always gets re-executes.
Thanks ahead,
Norberto
Problems wit events
by Rich Mercer » Fri, 10 Oct 2003 18:01:48 GMT
The Page_Load event is always called before any control
event. Try placing your Page_Load code into a method and
call the method from Page_Load using the IsPostBack
property to only call it on the first page load then you
can call it from your controls event if you need to but
it wont execute after a post back.
HTH.
Rich Mercer
MCAD
method on mouse click
the page_Load before
event and If its
set this code in the
fired when I click
ByVal e As
System.Object, ByVal e As
F5 function key, the
Re: Problems wit events
by Norberto Mes Lez » Sat, 11 Oct 2003 02:37:42 GMT
Thank for your help
But I Also I have another problem if i refresh the page with F5 function
key, the click event on the botton always gets re-executes.
Thanks ahead,
Norberto
Similar Threads:
1.Problem with User Control and unset references to controls wit
Thx for reply,
i should have said, declaratively
e.g.
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<Nc:ItemDataList ID="MyItemDataLisy" runat="server"></Nc:ItemDataList>
</form>
</body>
--
TIA
Sam Martin
" XXXX@XXXXX.COM " wrote:
> Hi,
>
> How are did you load the user control - declaratively or
> programmatically?
>
> Regards.
>
>
2.Problems wit Databinding to a DropDown box
Hello,
I have done the following to bind data to a DropDown box:
1. Drag SQLServer table onto web form to create data connection and data
adapter.
2. Generate dataset by right-clicking on the data adapter ad selecting
generate dataset.
3. Setting the drop down box propertied to reflect so that:
Datasource = Dataset11
Datamember = table
Datatextfield = tablerow
Datavaluefield = tablerow
When I run the application I don't generate any errors, but no data is
present in the DropDown box...Well, actually I get a drop down that is
blank.
Any ideas an what Imay be doing wrong?
Also, if I code the information, can I put it in the CodeBehind file or does
it have to be in the actual ASPX?
Thanks in advance,
Kris
3.Problem wit .NET forms
Hi all,
starting from about a week ago I have strange behavoir of VS2003. All .NET
forms in designers are loading very slow (about 5 min) and the processor
load goes to 100%. I can't remember to change something in the options or
installing something unusual (may be just testet CLR Spy,which is now
disabled).
May be anybody has an idea what it could be.
Thanks,Boni
4.Problem wit std::string::substr
Hi all,
Following code causes strAddress to contain garbage data.
When I decrease number of characters that appear before '\\' then everything
is ok.
12 chars before '\\' seems to be a magic number.
I have compiled it with VisualStudio 2003.
Any ideas?
std::string strAddress = "123456789012\\aaaaa";
std::string::size_type pos = strAddress.find('\\');
if( pos != std::string::npos )
{
strAddress = strAddress.substr( pos + 1, 2 );
}
Thanks in advance for any help.
Jarek
5.Help Please Wit Error
Hey Guys,
I trying to create an application that uses an OLEDBConnection.
Every time I try to run my app when I get to the opening of the
connection I get this error.
"The .Net Framework Data Providers require Microsoft Data Access
Components (MDAC). Please install Microsoft Data Access Components
(MDAC) version 2.6 or later."
I have downloaded the latest version of MDAC (2.7) and installed it but
i still get the same error. I downloaded this utility from MS and its
supposed to check which version of MDAC i have installed and it says I
have all of them installed from 2.1 to 2.8 sp1. It doesn make any
sense, I have used this type of connection before but i have formatted
since so I not sure if there is some little setting that i missed or
if i just got lucky last time. Any input will be greatly appreciated so
thx in advance.
- Adam
P.S.
I am running Windows XP Pro SP2 with Visual Studio .NET 2003 & Visual
Studio .NET 2005 Beta 2. I had the same problem without VS.NET 2005
installed I was kind of hoping that hen I installed VS.NET 2005 it would
fix my problem but it didn.
6. How to combine Asp.net wit hms.exel ?
7. At my wits end
8. At wit's end...