|
tgis is very simple.Did you try something?
Dropdown's selectedindexchanged event is called only you one change the index if selects the same again and again then it is not callled and there is no postback occurs in this scenario.
|
|
|
|
|
thanks for the reply, In fact you are true, but what happens when you first select Index 1 then index 2 then again index 1, I am sure I will do a postback which I dont wanted to do. I would like to store it at some client side variable. any ideas?
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
When changing the selected Index, fire a javascript function which check whether the selected index is in the list of values stored in hidden variables if it is return false from the Javascript Method.
|
|
|
|
|
Hi,
in my string array,i am getting some values like this
str[0]="sree"
str[1]="jith"
str[2]="addr"
str[3]="pin"
str[4]=""
str[5]="abc"
str[6]="ghghj"
str[7]="ytu"
str[8]="ytuyi"
.
.
.
str[80]="hjk"
i ve to retriev data from this string according to the empty string and assign to a gridview row.
ie when count is on ""
i ve to assign it to corresponding textbox in gridview .
ie bind name as sree in textbox.
Any Idea?
Known is a drop, unknown is an ocean
|
|
|
|
|
Your question is not clear.
But as I understood, if you want to do some modification in displaying the data in gridview, hen you can do it in GridView.RowDataBound event.
For details of this event have a look
|
|
|
|
|
No, My question is how can we get that data from string array.
i ll explain it briefly.
there is a multiline textbox where user can copypaste some data like this
Sreejith
604 E 25th St
Chennaie, WY 82001-3133
Phone: (45) 67-64456
Rajesh
1609 E 19th St
Chennaie, WY 82001-4990
Phone: (453) 564-95654
Ramesh
1002 Rumsey Ave
Codys, WY 82414-3533
Phone: (307) 587-3008
this details may vary according to user input.
i am assigning this values in a string array.
string[] strData = strPasteData.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
while running if i insert a breakpint here and checking for data i am vieing data like this
str[0]="Sreejith"
str[1]="604 E 25th St"
str[2]="Cheyenne, WY 82001-3133"
str[3]="Phone: (45) 67-64456"
str[4]=""
str[5]="Rajesh"
str[6]="1609 E 19th St"
str[7]="Chennaie, WY 82001-4990"
str[8]="Phone: (453) 564-95654"
str[9]=""
str[10]="Ramesh"
str[11]="1002 Rumsey Ave"
.
.
.
.
but my question is how can we this dynamic data into into gridview
ie in my gridviw there are 4 columns
Name
Address
Address2
Phone
I ve to assign values from string array to corresponding fields
In first row i need
Sreejith,604 E 25th St,Chennaie, WY 82001-3133,Phone: (45) 67-64456
2nd row
Rajesh,1609 E 19th St,Chennaie, WY 82001-4990,Phone: (453) 564-95654
this is my requirement
Known is a drop, unknown is an ocean
|
|
|
|
|
You can not directly bind it in gridview in this form.As Abhijit suggested, create a datatable with your column names and add all the records as seperate rows like for
Sreejith
604 E 25th St
Chennaie, WY 82001-3133
Phone: (45) 67-64456
DataRow dr = dt.NewRow();
dr["Name"] = "Sreejith";
dr["Address1"] = "604 E 25th St";
dr["Address2"] = "Chennaie, WY 82001-3133";
dr["Phone"] = "Phone: (45) 67-6445";
dt.Rows.Add(dr);
dt.AcceptChanges();
Hope it'll help
|
|
|
|
|
Hi,
That I know.I think still you are not clear about my question,
u r telling to do it as static.But my qn is how to do it dynamic?
ie instead of
DataRow dr = dt.NewRow();
dr["Name"] = "Sreejith";
dr["Address1"] = "604 E 25th St";
dr["Address2"] = "Chennaie, WY 82001-3133";
dr["Phone"] = "Phone: (45) 67-6445";
dt.Rows.Add(dr)
dt.AcceptChanges();
i need to get all data from that string array.
DataRow dr = dt.NewRow();
string[] strData = strPasteData.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
dr{"Name"]=strData[i].ToString();
dr["Address1"]=strData[i].ToString();
dr["Address2"] =strData[i].ToString();
dr["Phone"]=strData[i].ToString();
Sreejith604
E 25th StChennaie,
WY 82001-3133
Phone: (45) 67-64456
consider the above data as 1 single record
but the problem is user will paste about 10 record at a time in a multiline textbox.
Here "" is the delimiter.if user entered 10 record there will be 9 ("")empty string to separate different data.
Known is a drop, unknown is an ocean
|
|
|
|
|
so similarly you can add the rows in table dynamically,If you user pastes 10 or record, as you are readin string ,have a loop of he no of recods that user pasted and add the row dynamically based on the entered text.and at last bind it to the gridview.
Might be i cannot understand your proble, but if you know yje delimiters then you can create dynamic datatable as well.
|
|
|
|
|
Try to use DataTable and DataRow and then assign the DataTable to GridView Source.
DataTable dt = new DataTable("Table1");
dt.Columns.Add("Name");
dt.Columns.Add("Address1");
dt.Columns.Add("Address2");
dt.Columns.Add("Phone");
DataRow dr = dt.NewRow();
Now add value for dr["Name"], dr["Address1"] ..... Finally Do the AcceptChange for Data Row. Create New Row for new records ( In your case it is "") and finally Assign the Data Table to GridView.
|
|
|
|
|
Hi,
That I know.I think still you are not clear about my question,
u r telling to do it as static.But my qn is how to do it dynamic?
ie instead of
DataRow dr = dt.NewRow();
dr["Name"] = "Sreejith";
dr["Address1"] = "604 E 25th St";
dr["Address2"] = "Chennaie, WY 82001-3133";
dr["Phone"] = "Phone: (45) 67-6445";
dt.Rows.Add(dr)
dt.AcceptChanges();
i need to get all data from that string array.
DataRow dr = dt.NewRow();
string[] strData = strPasteData.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
dr{"Name"]=strData[i].ToString();
dr["Address1"]=strData[i].ToString();
dr["Address2"] =strData[i].ToString();
dr["Phone"]=strData[i].ToString();
Sreejith604
E 25th StChennaie,
WY 82001-3133
Phone: (45) 67-64456
consider the above data as 1 single record
but the problem is user will paste about 10 record at a time in a multiline textbox.
Here "" is the delimiter.if user entered 10 record there will be 9 ("")empty string to separate different data.
IT IS LITTLE BIT COMPLICATED SO IT TAKES SOME TIME TO UNDERSTAND REQUIREMENT
Known is a drop, unknown is an ocean
|
|
|
|
|
Hi,
I'm using session variable in my project, which is been used in each and every page. but right now i'm checking session in every page before using it's value.
Is there any other way to manage session. so that i need not to check session in every page?
Waiting for your valuable response.
Thanks
Krishna veer singh
krishna veer singh
|
|
|
|
|
once u give a value to session variable, it will remain d same, until the session expires or u modify that variable...so why u need to check that in every page...
|
|
|
|
|
sriharsha_12 wrote: until the session expires or u modify that variable
sriharsha_12 wrote: so why u need to check that in every page
Because it could have expired or been changed
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
krishnaveer wrote: Is there any other way to manage session. so that i need not to check session in every page?
There are ways, but simple way is this only.Whenever a pageload occurs have some common function that is called to check, whether session is alive or not ,accordingly take further actions.
For more details Have a look
|
|
|
|
|
I have an Ajax ModalPopupExtender, inside an UpdatePanel, with a Submit button that triggers a click event.
It works fine the first time. If after using it I display the page without the Popup, and then later show it
again, it works fine again. But if right after showing it (and the client submitting it), I display the page
with the popup showing again, it's displayed ok, but if Submit is clicked, it just disappears, but there is no postback to the server.
If I look at the html source sent to the browser in this second display, it contains extra code (something
about AjaxControlToolkit.ModalPopupBehavior.invokeViaServer etc.). But nothing is different in the code that
executes, except that the previous display was different. I've tried using UpdatePanel.Update(), but the behavior remains the same.
I have not been able to find any discussion on the web of this specific scenario. Can anyone help?
|
|
|
|
|
Hi,
I too have the same problem but in my case first time the modal popup will fire and call the server side code and in the next time if i click on the button which fires the modal pop up nothing happens.
please let me know if you get any solution
Thanks,
Vasanth
|
|
|
|
|
Thank you for commenting, Vasanth.
I found no solution, but I am using the following workaround:
- I send out the same page WITHOUT the popup (this seems to
clear whatever setting is causing the problem)
- and then send it out AGAIN, this time with the popup, which
then works ok
- however, if the second send is done too quickly after the
first, it sometimes produces a spurious "Event Validation.."
error - so I've had to turn off EnableEventValidation on
that page (which is not good, but I do my own programmatic
validation)..
Victor.
|
|
|
|
|
Hi,
How we can create ISAM(indexed sequential access method) files?
G. Satish
|
|
|
|
|
How does this related with ASP.NET ?
|
|
|
|
|
Respected,
How to Create Sheduling For Send SMS in asp.net
Please help .
Thanks And Regards,
Lalit
|
|
|
|
|
Nothing to do woth ASP.NET. Create some WindowsServices / Console Application with Schdule Time - That will send SMS to the given list of number.
Now how to send SMS for that you need to look at Google !
|
|
|
|
|
Hey create a windows service and set its time interval. Following are the links which help u...
For creating a windows service
Link
For sending sms
Link1
Link2
|
|
|
|
|
hi
im trying to build a form that enters data from textboxes into my xml file
i need to get to this :
<br />
<chores><br />
<day label="A" ><br />
<job price="30" product="bla bla" size="20x33" amount="22"/><br />
<job price="30" product="bla bla" size="20x33" amount="22"/><br />
<job price="30" product="bla bla" size="20x33" amount="22"/><br />
<br />
</day><br />
<br />
</chores>
can anyone please tell me what should i exactly write in my C# code to get this working?
thanks
modified on Friday, April 9, 2010 12:43 PM
|
|
|
|
|
So what is the problem?You can create the xml in C# very easily.Did you try something?
for samples have a look to the following links
-Link 1
-Link 2
|
|
|
|