|
playing with bugs ) wrote: But if you see the how CLR going to call these 2 sentences i think that makes the difference
I am not getting how this can make a performance difference ? What made you to think so ?
|
|
|
|
|
Just wanted to know is there performace issue in it.
i think you are right there is not much difference in both
Thanks
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Although, if it makes any extra performance, it would be very less and negligible. Those two are two types of approach to the problem.
|
|
|
|
|
Choose whatever way is going to be the easiest to read. The performance differences will be negligible in the big picture, but if you 'pre-optimise' your code too much, you could go back to it in a years time and have no idea what you were trying to do...
keep it simple.
|
|
|
|
|
Very well said Paddy
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hi i have a datagrid..in the datagrid
there are two columns.. named "username" and push button columns named "send"(like edit button in the datagrid")..
i have the two userid values "5,1"(i am getting thsese values dynamically"..
now i have todisable the pushbuttons whose userid are 5 and 1.
how can i do this in asp.net
|
|
|
|
|
hi,
in the datarow bound event you can hide cell.
like.
if(e.row.cell[1].text == "1" || e.row.cell[1].text == "5" )
{
e.row.cell[1].visible == false;
}
format as required.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Hi,
I am publishing my website containg some events in Global.asax file. And I upload my published copy to server. I am getting some errors like which means that server not getting events from Global.asax file. And actually there is not any Global.asax file in my published copy. This does not create any problem to my local server or my local lost.but creates problem in live server. So please give me some idea regarding this.
Thanks in advance.
Naresh Patel
|
|
|
|
|
Hi,
hey in IIS selected asp.net version is 1. or 2. ??
It must be 2..
check it.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
If we add a command field into grid view control for selecting the particular row in grid.if we select more than 2 rows ,how it will be assign to an arraylist
|
|
|
|
|
Hi,
how you are going to select more than 1 row ?
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
|
Hi,
for that you have to use viewstate and have to add arraylist in viewstate, and have to append arraylist on every selecion of row of gridview.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Send some code realted to this sir
|
|
|
|
|
Hi,
you have to try once..
add item in arraylist in gridview selected index changed event,
ArrayListarr = new ArrayList(); // declare in page load
now in selected index event
check ViewState["Arr"] is null or not.
if not then
arr = (arraylist) ViewState["Arr"];
else
'do nothing
now
arr.Add("get value");
ViewState["Arr"] = arr;
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
What is this Arr and getvalue plz help detaily
|
|
|
|
|
Sun Rays wrote: ArrayListarr = new ArrayList(); // declare in page load
ArrayList arr = new ArrayList();
Sun Rays wrote: arr.Add("get value");
getvalue is value which you are fetching from gridview's selected row.
As you want to add value from grdview.selected row's cell's value.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
protected void GrdChatUsers_SelectedIndexChanged(object sender, EventArgs e)
{
int i = GrdChatUsers.Rows.Count;
for (int j = 0; j < i; j++)
{
//string Arr = GrdChatUsers.Rows[j].Cells[2].Text;
ArrayList ar = new ArrayList();
if (ViewState["Arr"] != null)
{
ar = (ArrayList)ViewState["Arr"];
ar.Add(GrdChatUsers.Rows[j].Cells[2].Text);
ViewState["Arr"] = ar;
}
}
}
I tried the above code but i didnt get the value plz solve it
|
|
|
|
|
SreejithAchutan wrote: protected void GrdChatUsers_SelectedIndexChanged(object sender, EventArgs e)
{
int i = GrdChatUsers.Rows.Count;
for (int j = 0; j < i; j++)
{
//string Arr = GrdChatUsers.Rows[j].Cells[2].Text;
ArrayList ar = new ArrayList();
if (ViewState["Arr"] != null)
{
ar = (ArrayList)ViewState["Arr"];
ar.Add(GrdChatUsers.Rows[j].Cells[2].Text);
ViewState["Arr"] = ar;
}
}
}
Hi,
do below changes.
event must be below...
protected void GrdChatUsers_SelectedIndexChanging(object sender, EventArgs e)<br />
{<br />
<br />
ArrayList ar;<br />
if (ViewState["Arr"] != null)<br />
{<br />
ar = (ArrayList)ViewState["Arr"];<br />
}<br />
else<br />
{<br />
ar = new ArrayList();<br />
}<br />
ar.Add(GrdChatUsers.Rows[e.NewSelectedIndex].Cells[2].Text);<br />
ViewState["Arr"] = ar;<br />
}<br />
Hope it will help you...
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
in the database..in a table..........i have a field named "username".....
in the username. field "Ramesh" is there ..
i want to calculate that how many times "ramesh" is there in the username field..using sql
|
|
|
|
|
This must be in SQL Forum, this has nothing to do with ASP.NET.
Select count(*) from table where username = 'ramesh'
SG
Cause is effect concealed. Effect is cause revealed.
|
|
|
|
|
Hi! All
I ve to add controls dynamically to a webpage; so i did but i 've to initiate their events as well. I add events to them but their events are not called (such as if newControl.SelectedIndexChaged += new EventArgs(newControl_SelectedIndexChanged). but it not works it can not called to it handler.
So,
what should i do to activate their events. any suggestion will be anticipated.
Thanks in advance.
|
|
|
|
|
Hi,
do this.
DropDownList ddlMy = new DropDownList();<br />
ddlMy.Items.Add("test");<br />
ddlMy.Items.Add("test1");<br />
ddlMy.Items.Add("test2");<br />
ddlMy.Items.Add("test3");<br />
ddlMy.Items.Add("test4");<br />
ddlMy.AutoPostBack = true;<br />
ddlMy.SelectedIndexChanged += new EventHandler(ddlMy_SelectedIndexChanged);<br />
this.form1.Controls.Add(ddlMy);<br />
And create one event for that.
void ddlMy_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
lblMyDDL.Text =((DropDownList)sender).SelectedItem.Text;
}
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Thanks 2 all; for reply
I already did, only thing i missed to set autopostback = true of a control.
Thanks again.
Reagard
|
|
|
|
|
Post your code
please don't forget to vote on the post that helped you.
|
|
|
|