473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

display database values in textboxes and pass parameter in response.redirect

3
Hello Guys,

I have a datbase with userid,username and password.
I Need to display database values in textboxes say for eg(Name and password) and redirect to login page based on the UserID please need a help

Thanks
Surag
Sep 9 '10 #1
7 9267
Frinavale
9,735 Expert Mod 8TB
I'm not sure what you're having problems with?

To display text in a TextBox set the TextBox.Text property to the text that you want to display.

To pass values from one page to another you could use Session, or you could pass the information via the URL during the redirect. I wouldn't recommend using the URL though because you're dealing with password information...well unless you passed the UserID via the URL and retrieved the password based on that value in the page that you are redirecting to.

Please elaborate on what you are trying to do and what you have done so far to solve the problem.

-Frinny
Sep 9 '10 #2
Surag
3
Hi,
Thanks for replying me!!
am listing you with detail ,am using repeater control and displaying database values and even able to delete the selected values!!
want i want to do is once if any user selects any record from repeater control and clicks add button the selected record should be inserted in the user table followed wth the selected items id!!

so i need to redirect frm my login page to rptr control page and select any item from repeater control(using check box) and click add button so tht it will add to my tble!!
i even tried using sessions but am unable to do it please help me out

Thanks
surag
Sep 9 '10 #3
mzmishra
390 Expert 256MB
Try something like this
Expand|Select|Wrap|Line Numbers
  1. foreach (RepeaterItem dataItem in RepeaterName.Items)
  2. {
  3. CheckBox chk =(CheckBox)dataItem.FindControl("yourcheckboxname") ;
  4.  
  5. TextBox txt =(TextBox)dataItem.FindControl("yourTextboxname"); 
  6. if (chk.Checked)
  7. {
  8.  
  9. DoInsert(txt.Text);
  10. }
  11. }
I have assumed you are displaying data in textbox inside repeater.You can use the above code for your control
Sep 9 '10 #4
Frinavale
9,735 Expert Mod 8TB
surag: I am using repeater control and displaying database values and ...
want i want to do is once if any user selects any record from repeater control and clicks add button the selected record should be inserted in the user table followed wth the selected items id!!
Inserted where?
Where is the user table?

Are you retrieving data from one table in your database, and adding these records (if selected) to another table in the database?

Or are you retrieving data from your database, and then when the user clicks the "add" button, you want to add this record to a table (in memory) that is simply displayed to the user (not added to the database)?

surag: so i need to redirect from my login page to repeater control page and select any item from repeater control(using check box) and click add button so tht it will add to my tble!!
I really don't understand how redirecting ties into the "add-record" part of your question.

Typically a user logs in and they are redirected into the website (allowed access to the rest of the pages in the site).

Why do you have to redirect the user once the add-button is clicked??

-Frinny
Sep 9 '10 #5
Surag
3
hi Frinny,
thnaks for replying me,and
Thanks for ur patience! i thnk i confused u, oops!!sorry, let me eloborate wth examples:
in sql database i have 3 tables

Usertable: UserID,Uname,PWd
ContentTable: ContentID,Contentname
COmmontabel-UserID: ContentID(this is crucial)
(storing userid,and contentid i thnk u got my poin here)

now cmmng to .aspx pages
i have default.aspx with login control,
once user click on login (in databse checks for username and password if usernme and pwd are same )
and redirects to home.aspx

in home.aspx i have got repeater control which displays all the (contenttable data) and addbutton

so when user checks "check box" in repeater control and clicks "addbutton" based on his UserId(wth wch he login)
data should be inserted into Commontable(i.e UserId,ContentID)
Hpe u understand this time :(

Thanks
surag
Sep 9 '10 #6
Frinavale
9,735 Expert Mod 8TB
Ah now I understand.

Ok, when the user logs in, save the user's ID in Session before you redirect them to the home.aspx page.

Then in the home.aspx page you can retrieve the user's ID from session (if it's not there then you know the user is not logged in and you can redirect the user back to the default.aspx page).

You should probably retrieve the User's ID from Session in the Page Load event, check if it's nothing...and if it is nothing redirect the user back to the default.aspx page. Otherwise, you can allow the rest of the page to execute properly.

So, now that I understand the general flow of the, what are you having problems with exactly?

Are you having problems handling the "AddButton" click event?

Are you having problems with database stuff??

It would probably be best if you posted the code that you are having problems with so that we can work with what you have (at this point I'm not even sure if you're using C# or VB.NET)

-Frinny
Sep 9 '10 #7
how to handle button click event at here
as there are so many buttons but a common function has to be written
Sep 14 '10 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Bill | last post by:
I'm trying to retain a value that I pass to a processing page. When the page is done processing, I use the response.redirect to forward to the page I started on, and i want that page to hold the...
7
by: Anne | last post by:
hie there, i want to be able to pass multiple parameters to another page. currently, i am able to do so, but somehow i feel it is not the correct way to do it. below is part of what i have so far....
3
by: Sehboo | last post by:
On my ASP page, when I click a button, I want to do three things: 1. Check for some values. 2. Open a new window and pass some values as query string. 3. Redirect to some other page Here...
15
by: KBuser | last post by:
I recently developed an internal website with various queries against our SQL server. I added buttons with Response.Redirect. These buttons do not work with Internet Explorer, however when using...
3
by: Mark Huebner | last post by:
I have an aspx web page with the following C# code in the page load event. Can somebody tell me if the Response.Redirect() will cause my tLoadDNN thread to stop executing before it is finished? ...
5
by: venner | last post by:
I'm having an issue with an ASP.NET website after upgrading to ASP.NET 2.0. The website makes use of a central authentication service (CAS) provided at the university I work for. Each page checks...
5
by: Doug | last post by:
In the code below, I am trying to go from one asp page to another: For Each tripToAccept As String In tripsToAccept.Split("/"c) dataManager.UpdateTripDetail("Accept", CInt(tripToAccept),...
2
by: ghjk | last post by:
In my web page there is a table for displaying database values. For one column displays connected or Disconnected. If the database values is Disconnected i want to display the value in red color. How...
0
by: Sumprit Purabi | last post by:
Hi, everyone. I am using java swing. Till now I could able to display database values in a JTable by executing a query. Now, what i needed is that i have to place two buttons(PREVIOUS,NEXT) one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.