?
Solved

c# how can webcon trol fill user name

Posted on 2011-02-18
5
Medium Priority
?
330 Views
Last Modified: 2012-05-11
c# how can webcontrol fill user name automatic  fill username(david) and password (1234) in the sign inform

in this case if it have user name teera it should delete it and fill david
<span class="formValue">
        <input id="msuLoginName" name="msuLoginName" value="teera" class="text rightEdge" style="width: 276px; height: 16px;" type="text">
</span>
    </div>
    <div class="formRow">
      <span class="formName">
         <label for="msuPassword">Password:</label>
</span>
      <span class="formValue">
        <input id="msuPassword" name="msuPassword" class="text rightEdge" style="width: 276px; height: 16px;" type="password">
</span>

Open in new window

0
Comment
Question by:teera
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 5

Expert Comment

by:sameer_goyal
ID: 34931813
Your question is not very clear. Please correct if I understand it wrongly.

You want to know how can you make a user control which includes a textbox for username and a password, automatically. right?

If yes, then you can use properties to do this. In your user control, you need to define public properties which you will populate on the Page_Load of your webpage which uses the user control.

Your property's 'SET' clause should then assign the value to the TEXT property of the textboxes.
Hope it helps.

If this is not what you were looking at, please clarify and i will try to help you out.
0
 
LVL 20

Expert Comment

by:informaniac
ID: 34931827
Is it possible to set the textbox tht has a password property from code-behind. I dnt think so.
0
 

Author Comment

by:teera
ID: 34931883
Hi expert
   My job is go to website and post promotion of the shop I need to put user name and password then put my personal information the problem is auto complete pro gram not work well for my language My idea is use c# to fill some information and some in formation some and the rest i fill by myself so I just want some example to do this
0
 
LVL 5

Accepted Solution

by:
sameer_goyal earned 1200 total points
ID: 34931897
Ok, that is very easy.. Do you have the code for the website that you work on? if yes, then you will have to add a method which will pre-fill the webpage with whatever information you want and load it.

For eg. lets say the web page has the following Text boxes:
txtUserName
txtPassword
txtFirstName
txtLAstName
txtAddress
txtPhoneNo

etc

Now in the Page_Load event of the Page, you can call a method, for eg, LoadProfileInformation()

And this method would be like:

private void LoadProfileInformation()
{
DataSet dsNew = new DataSet();

//Some code to fetch information if you store it in a DB else you can put in static info if you may want. //so you will nto need the dataset.

in case of static Info:

txtUserName.Text = "MyUserName";
txtPassword.Text = "MyPassword";
txtFirstName.Text = "MyfirstName";
txtLastName.Text = "MyLastName";

and so on..

}

This should do the trick.

Hope it helps.
0
 
LVL 6

Assisted Solution

by:Ramone_Hamilton
Ramone_Hamilton earned 800 total points
ID: 34932292
I think this depends on what type of site you are talking about, i.e. is this a  site that you are creating or is this an external site.  If this is an external site, and considering the form above only contains htlm controls rather than server controls, you might be much better off using an automation tool like autoIt that can input values based off of physical locations.

If you do have access to the code within this app you have several options, you can use javascript, change the controls to serverside controls and use C#, or just use C# from the jump in the code behind.  
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question