Solved

c# how can webcon trol fill user name

Posted on 2011-02-18
5
321 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
Comment Utility
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
Comment Utility
Is it possible to set the textbox tht has a password property from code-behind. I dnt think so.
0
 

Author Comment

by:teera
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
c# string 6 39
WPF issue with Trigger 2 65
Default parameter problem in C# 3 25
Calling stored proc in EDMX 11 17
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now