|
I can't say now what exactly would be the problem in this case unless I see the code.
But suppose if you want to keep multiple records of the same type then what you can do is to create a datatable and insert the data dynamically to that datatable. You can store that datatable temporarily some where and at the final save take the data from the datatable and then put it in the database.
Apurva Kaushal
|
|
|
|
|
S i know that method.. but y m trying is , v want to avoid the postback..
let me explain the thing..
i have a page for enter product code and Quantity,
so 2 txtboxes. txtpcode1, txtqty1
the txtboxes increases when the user press add more
and the name of txtboxes will b like txtpcode2 , txtqty2.......
up to this wrking fine.
but i hve to get the values from tat txtboxes in codebehind, so tat v can save it.
hope now u got me..
|
|
|
|
|
SamRST wrote: the txtboxes increases when the user press add more
SamRST wrote: v want to avoid the postback.
That means you are using javascript to add the element in the web page. Am I right here?
If so then you have to store the values of the textbox in some hidden field otherwise you will not be in a position to access the same on the server.
Apurva Kaushal
|
|
|
|
|
S m using javascript to add elements.
but how can v store the values in hidden field, if d textbox increases to 20 or 30. And also , each row tere will b 2 txtboxes for pcode and qty.
|
|
|
|
|
You can store the values in hidden field by delimiting it with a semi colon or some thing else. What you need to do is to keep appending the values in hidden field when you are adding the controls.
Apurva Kaushal
|
|
|
|
|
i got ur idea. but the thing is how v vl seperate each row
for eg.
pcodtxt qtytxt
a102 10
B1025 20
c1000 12
35622 5
3698 25
As per ur suggestion:
a102;10;B1025;20;c1000;12;35622;5;3698;25;
here wich is pcode , which z qty. ???????
|
|
|
|
|
SamRST wrote: As per ur suggestion:
a102;10;B1025;20;c1000;12;35622;5;3698;25;
here wich is pcode , which z qty. ???????
Here you are separating the records with a semi colon similarly you can separate the fields with a comma. Then you can get the data like this:
a,123;b,2345;c,2222;
Hope this will be clarifying the issue.
Apurva Kaushal
|
|
|
|
|
ok, its good.
but i hve 1 more pblm.. dont hit me .. Okay...
now times v added the rows..
vat will happen if v delete a row.
mm m m m ......
|
|
|
|
|
i hve a great thanks for ur replies...
Thank u so much...
exact pgrmer.. Okay..
|
|
|
|
|
Always welcome.
Apurva Kaushal
|
|
|
|
|
What you need to do in that case is every time you are adding the control refresh the complete hidden field this you have to do in case of deletion also.
What I mean to say here is when you are adding a new one then clear the hidden field and then add the complete set again by looping through. And this has to be repeated in the case of deletion.
Apurva Kaushal
|
|
|
|
|
SamRST wrote: i want to enter multiple data's , like sales invoice. Does anybody have idea. Page should not postback.
Read the forum rules[^], paying particular attention to no. 2.
If you don't understand the basic principles of developing ASP.NET data entry applications, posting questions on a forum isn't going to help you. If this a commercial project, does your company know that you don't have the skills to complete it? The only advice I can give you is to go away, read a few books and and learn your craft.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I want to be able to get the windows Username of the user on my system from Active directory.
Anyone know how to do this?
macca
|
|
|
|
|
i dont think you can do this
|
|
|
|
|
It can be done, but it means granting appropriate privleges to the context under which your site runs, which is not always a good idea.
|
|
|
|
|
Sure it can be a mess... but in case you want to retrieve the username of whoever is using your app in the other side, I believe a simple My.User.Name in the codebehind may work.
Kazz
"Users are there to click on things, not think. Let the archs do the damn thinking."
|
|
|
|
|
I would like to bind resource files of various cultures to controls which gets created dynamically ..
thanks in advance ,
FAIZAL AHMED.H
|
|
|
|
|
Why don't you try searching on google for this question you are just as likely to find an answer
|
|
|
|
|
I would like bind resource files of various cultures to controls which gets created dynamically ..
thanks in advance ,
FAIZAL AHMED.H
|
|
|
|
|
|
Hi,
i have a requirement to send sms to users for every 5 min getting new data from databse. sending sms in diff conditions. Need to some on specific timings like that etc.
I want to do this using windows services. is it ok for me to start with this? Or any other better alternative is there to do this ?
G. Satish
|
|
|
|
|
HI,
YOu can use BackgroundWorker if you are working in Windows Form Application.
Naresh Patel
|
|
|
|
|
N a r e s h P a t e l wrote: use BackgroundWorker if you are working in Windows Form Application.
Background worker class is not limited to windows applications. It can be used in web applications too. It's juts a helper class for threading.
|
|
|
|
|
Yes windows services is a good way to go.
|
|
|
|
|
I disagree as he doesn't need a realtime process. I think too many people write WindowsServices when a service isn't specifically needed. I propose that you should write a simple console application and use the scheduling functionality of the OS to run that console application on the time frame you need.
|
|
|
|