Solved

c# how can webcon trol fill user name

Posted on 2011-02-18
5
328 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
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 300 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 200 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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