|
Nagendra,
Thanks for the debug tip. After stepping into the code, I saw that the button click event fires again when I refresh the page... very frustrating!! So to remedy it as quickly as possible, I created a small method that would check to see if the button click event would 'quilify' to be fired given user's input.
I just don't have the time to investigate this silliness- need to keep the boss happy
Thanks again!
Nila
|
|
|
|
|
Hai,
That is a Good Method of Making your self Comfortable in Office.
But you try it later and you can come across some good concepts in that area.
and if possible send me that page complete as an attachment to nagendrarao@glowtouch.com.
|
|
|
|
|
It's not about making myself comfortable; Im just trying to remedy this and move on- there is lots of pressure when you develop for an emergency operations type group.
And I agree with you on finding out exactly WHY sometimes things behave the way they do But now is not the time for that, maybe later. Let me do a couple of things, and then I will send you the code.
Thanks again!
Nila
|
|
|
|
|
just put and change according to ur need following code into
public partial class<br />
{<br />
private bool _refreshState;
private bool _isRefresh;
<br />
public bool IsRefresh
{<br />
get <br />
{<br />
return _isRefresh;
}<br />
}<br />
protected override object SaveViewState()<br />
{<br />
Session["_ISREFRESH"] = _refreshState;
object[] allstates = new object[2];
allstates[0] = base.SaveViewState();
allstates[1] = !_refreshState;
return allstates;<br />
}<br />
protected override void LoadViewState(object savedState)
{<br />
try<br />
{<br />
object[] allstates = (object[])savedState;
base.LoadViewState(allstates[0]);
_refreshState = (bool)allstates[1];<br />
_isRefresh = _refreshState == (bool)Session["_ISREFRESH"];<br />
}<br />
catch (Exception e)<br />
{<br />
}<br />
}<br />
}
and which event is called thru Refresh just put flowwowing code into
if (_isRefresh == false)<br />
{<br />
<br />
your code for event is here<br />
<br />
}
hope tht'll helps u
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
Thanks Deepak!
There has got to be a bug in this, because the button click event fires all on its own when I refresh the page... so I finally decided to create a small private method that checks to see whether or not events in the button click would 'quilify' to be executed - very similar to your approach. Thanks again, don't know what I would do without all you guys' help and support!!!!
Nila
|
|
|
|
|
Dear All
i am bit new to dotnet. currently making web application using asp.net and C#(VS2005). i have dropdownlist control(Autopostback is true) on its selected index code
i have wrote dropdownlist_selectedindex as follows its works fine whenever there is more than one record(by fine i mean in debug mode, control flow through it ) but for singal record
controls does not go through it. What is a problem. Please guide me.
thanks
protected void DropDownListinquiryid_SelectedIndexChanged(object sender, EventArgs e)
{
setting = ConfigurationManager.ConnectionStrings["databaseconnection"];
if (setting != null)
{
conn = new SqlConnection(setting.ConnectionString);
conn.Open();
query = "select max(inquiryid) from followupdtl where inquiryid='"+DropDownListinquiryid.SelectedItem.Text+"'";
cmd = new SqlCommand(query, conn);
if (cmd.ExecuteScalar().ToString().Equals(""))
{
txtmaxno.Text = "01";
}
else
{
int number = int.Parse(cmd.ExecuteScalar().ToString());
number++;
if (number.ToString().Length == 1)
{
txtmaxno.Text = number.ToString("0#");
}
else
{
txtmaxno.Text = number.ToString("##");
}
}
}
}
regards
imran khan
|
|
|
|
|
I would guess that because you only have one item in the the list the selected item can't change, there is nothing to change, so the event is never triggered. Try adding a empty item at the top of the list.
only two letters away from being an asset
|
|
|
|
|
#1: A change event will never fire if there is only one choice and it's already selected. Try adding a "Select an item" in the first position.
#2: Separate out the database code into it's own function/method that returns the value returned from the DB.
#3: There is no need to call cmd.ExecuteScalar more than once. Store the value in a variable.
|
|
|
|
|
i was also fce tht problem at last i'd tht
into dropdownlist
i entered a Select field into 0 index thru properties
hope tht'll hepls u
Deepak
Smile a Lots,Its Costs Nothing
|
|
|
|
|
im making a contact form in that im maling all information to the provider. but wat method i use im not getting
plz help
|
|
|
|
|
May be u can use this :
Imports System.Net.Mail
|
|
|
|
|
i did use that but when i create my own method named as SENDMAIL it give error of namespace.
should i give u code
|
|
|
|
|
Are you sure the assembly is referenced in your project?
only two letters away from being an asset
|
|
|
|
|
|
you must import "Imports.System.Web.Mail"
Then use this code:
Dim objEmail As New MailMessage<br />
objEmail.To = "To Email"<br />
objEmail.From = "Your Email"<br />
objEmail.Subject = "Your Subject"<br />
objEmail.Body = "Hello"<br />
objEmail.Priority = MailPriority.High<br />
objEmail.BodyFormat = MailFormat.Text<br />
SmtpMail.SmtpServer = "Your SMTP Server"<br />
<br />
Try<br />
SmtpMail.Send(objEmail)<br />
Catch exc As Exception<br />
Throw exc<br />
End Try
This will help you!!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Hello,
I have a CRecordset object for a table .I want to know the number of primary keys in a table alongwith the Column Nos.
can I use IsFieldNullable method for this purpose?
Thanks
Prithaa
|
|
|
|
|
A CRecordset object? There is no such class in the framework. Is this a C++ question?
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa wrote: Is this a C++ question?
MFC if I remember correctly....oh and to answer the question, no - can't use IsFieldNullable for that, since it will give you "false positives"...seem to remeber that you need to look at the props of each in turn for a particular flag, though can't off the top of my head remember what it is...
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
And anyway, just because a field is null, it doesn't mean that you can assume that it is part of a key.
|
|
|
|
|
|
Its a JavaScript menus... You can do wonders using JavaScript...
|
|
|
|
|
Looks like a div with a table inside it - nothing too spectacular there
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
InvalidCastException
Conversion from string "A10001" to type integer is not valid
I have a query that returns a dataset from a database table. The field i am using as the criteria for fetching the data is of type Text(or Char).
Whenever i passed a value like "110000" there is no problem. But when i passed a value like "B235KK", THE ERROR ABOVE comes up.
pls help
t.aransiola
|
|
|
|
|
Could you post that code?
|
|
|
|
|
I will post that of the dataset later, but also i have this code as well reporting teh same error
Protected Sub form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Load
Dim strClientID As String = CType(Session.Item("ClientID"), String) '"00144"
Dim strFormula As String = "{Client.ClientID}='" & strClientID & "'"
CrystalReportViewer1.SelectionFormula = strFormula
Sub
t.aransiola
|
|
|
|