|
I know about the scope of static variable, consider the following code i thing u understand that what i need
//Declare on Top
public static DataTable dt = new DataTable();
//on page load
{
dt.Columns.Add("HName");
dt.Columns.Add("fee_type");
dt.Columns.Add("fee");
dt.Columns.Add("disc");
dt.Columns.Add("net");
}
//DataList itemCommand Event
protected void drphead_item(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "add")
{
lblerror.Visible = false;
DataRow dr = dt.NewRow();
LinkButton lb = new LinkButton();
lb = (LinkButton)e.Item.FindControl("LinkButton1");
lb.Enabled = false;
dr[0] = lb.Text;
dr[1] = "Yearly";
dr[2] = 0.00;
dr[3] = 0.00;
dr[4] = 0.00;
dt.Rows.Add(dr);
dlFeeHead.DataSource = dt;
dlFeeHead.DataBind();
}
Every time when user clcik on linkbutton (which is into the datalist control) accordingly the new DataRow is created it run perfactly, but the problem is occured when application run on two or more machine which i explained before....
If u have some solution then please reply thnks in advance....
|
|
|
|
|
gurdeep_677 wrote: static
Remove static .
gurdeep_677 wrote: I know about the scope of static variable
If you where knowing that, I am sure you don't write these code.
|
|
|
|
|
I know about the scope of static variable, consider the following code i thing u understand that what i need
//Declare on Top
public static DataTable dt = new DataTable();
//on page load
{
dt.Columns.Add("HName");
dt.Columns.Add("fee_type");
dt.Columns.Add("fee");
dt.Columns.Add("disc");
dt.Columns.Add("net");
}
//DataList itemCommand Event
protected void drphead_item(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "add")
{
lblerror.Visible = false;
DataRow dr = dt.NewRow();
LinkButton lb = new LinkButton();
lb = (LinkButton)e.Item.FindControl("LinkButton1");
lb.Enabled = false;
dr[0] = lb.Text;
dr[1] = "Yearly";
dr[2] = 0.00;
dr[3] = 0.00;
dr[4] = 0.00;
dt.Rows.Add(dr);
dlFeeHead.DataSource = dt;
dlFeeHead.DataBind();
}
Every time when user clcik on linkbutton (which is into the datalist control) accordingly the new DataRow is created it run perfactly, but the problem is occured when application run on two or more machine which i explained before....
If u have some solution then please reply thnks in advance...
|
|
|
|
|
gurdeep_677 wrote: I know about the scope of static variable
gurdeep_677 wrote: but the problem is occured when application run on two or more machine which i explained before....
Well, that's what static MEANS. Why are you making it static ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I'd suggest reading a book on C#. Your code is doing exactly what you're asking it to do.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
dear i know about the static members but i have some problem, consider the following code if found any solution so please reply thanks in advance....
public static DataTable dt=new DataTable();
//on page load
dt.Columns.Add("HName");
dt.Columns.Add("fee_type");
dt.Columns.Add("fee");
dt.Columns.Add("disc");
dt.Columns.Add("net");
//DataList ItemCommand Event
protected void drphead_item(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "add")
{
lblerror.Visible = false;
DataRow dr = dt.NewRow();
LinkButton lb = new LinkButton();
lb = (LinkButton)e.Item.FindControl("LinkButton1");
lb.Enabled = false;
dr[0] = lb.Text;
dr[1] = "Yearly";
dr[2] = 0.00;
dr[3] = 0.00;
dr[4] = 0.00;
dt.Rows.Add(dr);
dlFeeHead.DataSource = dt;
dlFeeHead.DataBind();
}
|
|
|
|
|
I don't see what the problem is. If you make it static, it's the same for all pages. That's what static means. Why are you using static and what is your specific problem ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
hello sir
i m using javascript function for displaying large image(shown in datalist)...my function is
function ShowToolTip(con)
{
document.getElementById("div_img").style.visibility = "visible";
document.getElementById("img_tool").src =con.src.replace("SmallPic","BigPic");
document.getElementById("div_img").style.left = event.clientX ;
document.getElementById("div_img").style.top = event.clientY ;
document.getElementById("div_img").style.zIndex = "0";
}
and on mouseout...i use another function ie
function hideToolTip()
{
document.getElementById("div_img").style.visibility = "hidden";
}...
but the problem is this onmouseover of another image it first display the first image for some seconds and then the current image...so i want to use loading like http://www.templates.com/[^] ...please help me...how to solve this problem...
u can check my problem here http://www.eleegance.com/Default2.aspx?id=1[^]
|
|
|
|
|
You can use setTimeout function in javascript.
try this script
function ShowToolTip(con)
{
document.getElementById("img_tool").src =con.src.replace("SmallPic","BigPic");
document.getElementById("div_img").style.left = event.clientX ;
document.getElementById("div_img").style.top = event.clientY ;
document.getElementById("div_img").style.zIndex = "0";
setTimeout("Loading()",1000);
}
function Loading()
{
document.getElementById("div_img").style.visibility = "visible";
}
Regard
khan
please don't forget to vote on the post that helped you.
|
|
|
|
|
i have done this like..
document.getElementById("img_tool").onLoad = setTimeout("imageLoaded()",3000);
function imageLoaded()
{
document.getElementById("img_tool").src="pic/load.gif";
}
but its not working...please help me...
|
|
|
|
|
Neetu Maheshwari wrote: document.getElementById("img_tool").onLoad = setTimeout("imageLoaded()",3000);
If above line is out of function then it will not work.
try with my script
please don't forget to vote on the post that helped you.
|
|
|
|
|
Hi,whenever I am using update panel,i can not dynamically set focus to the control I want to.Should I use any Java Script?Can anybody help me out???Thanx in advance...
|
|
|
|
|
http://www.velocityreviews.com/forums/t369478-set-focus-to-a-control-inside-a-updatepanel-in-atlas.html
http://forums.asp.net/t/1027015.aspx
|
|
|
|
|
yes dear u can use javascript when u use UpdatePanel
in update panel some time document.getelementById("") is working properly.
U can use the javascript with ClientControl Id.
Simple add attibute in your codebehind file and passes ClientId control to the javascript like below;
.cs
Button1.Attribute.Add("onclick","javascript : return JSscript("+TextBox1.ClientID+");");
on javascripting
function JSscript(ctrlID)
{
ctrlID.focus();
return false;
}
I hope it will work for u ...
|
|
|
|
|
My project will be hosted in net.... Now i create the session for userlogin name.. this seesion create in my system hosting or web hosting..
|
|
|
|
|
nithydurai wrote: this seesion create in my system hosting or web hosting..
What do you mean ? Session will be created on the server where you host application.
|
|
|
|
|
But the session will be created in system not created on the server...
i want to create the session for server help me....
|
|
|
|
|
nithydurai wrote: But the session will be created in system not created on the server...
Session will be on server always. You miss the concepts. Please take a good book and learn.
|
|
|
|
|
This person always posts silly questions.
He needs to learn how asp.net works.
|
|
|
|
|
Session will be created on web server where you have hosted your application
cheers,
Abhijit
|
|
|
|
|
Hi i am sending mail to different ids...,
Everything going on well....,
I am going to make this application to exe and put it in schedular task...,
This things will execute automatically...,
Now my probs is suppose mailserver is down...,
Then it will be probs in mailsend...,
So in that case how to handle the code it mean if the mailserver will down or mail didnt send properly...,
Then it have to be fire again after some minutes or some other condition have to do how to do that?
This is my code:
DirectoryInfo dInfo = new DirectoryInfo(mypath);
DirectoryInfo[] dInfos = dInfo.GetDirectories();
foreach (DirectoryInfo d in dInfos)
{
MailMessage mailMessage = new MailMessage();
MailAttachment attach = null;
mailMessage.From = "Magesh@Test.com";
mailMessage.To = d.Name;
mailMessage.Subject = "Hi";
//mailMessage.Body = "Hi This One Is For Testing
FileInfo[] fInfos = d.GetFiles();
foreach (FileInfo f in fInfos)
{
attach = new MailAttachment(f.FullName);
mailMessage.Attachments.Add(attach);
}
SmtpMail.Send(mailMessage);
mailMessage.To = "";
attach = null;
}
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
You may use Ping command to check if the mail server is down or not.
Then, depending upon the outcome, you can decide what to do.
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
iam having nearly 45000 records in the data base where iam getting these many records into the grid view using the select statement in the oracle query .the problem it is more time consuming .is there is any aleternate solution to get these many or more than these record as fast as possible
|
|
|
|
|
Enable Pagination for the GridView. This would improve the performance of data loading
|
|
|
|
|
hi mr rider to implement this also the data should come fast na .my problem is the data is not getting faster from the data base.
|
|
|
|