Web Forms :: Changing Textbox To DDL?

May 17, 2010

I have a webform with difrent parts in it, its like a search criteria, noissues with other parts but theres one part in it called guest profile which is giving me problems.There was a field name called guest company with a textbox by its side, when the user enters the company name and clicks enter it displays the list of people with that company name

but now I have changed this textbox to ddl and populated this ddl with the company names now when I am selecting this company name and clicking enter its not showing the data the code for the above issue is shown below I have also posted the stored procedure used in this

the code used to design the DDL

<tr>
<th>
Guests Company:
</th>
<td>
<asp:DropDownList ID="ddlCompanyName" runat="server" CssClass="default" />
</td>
</tr>
the code used to bind the data to this ddl
protected void BindCompanyDDL()
{
var companyList = Company.FindAll();
ddlCompanyName.Items.Add(new ListItem("- Select Company -", ""));
foreach (var companyDetail in companyList)
{
ddlCompanyName.Items.Add(new ListItem(companyDetail.Name, companyDetail.Id.ToString()));
}
ddlCompanyName.DataBind();
}
the code used to initialize search
public void InitializeSearch(ref RecipientSearchParams searchParams)
{
if (!String.IsNullOrEmpty(txtGuestName.Text))
searchParams.GuestName = HttpContext.Current.Server.HtmlEncode(txtGuestName.Text);
if (ddlCompanyName.SelectedValue != String.Empty)
searchParams.CompanyName = ddlCompanyName.SelectedValue;
if (ddlCompanyType.SelectedValue != String.Empty)
searchParams.CompanyType = ddlCompanyType.SelectedValue;

the code used to load parameter values

public void LoadParamValues(RecipientSearchParams searchParams)
{
if (!String.IsNullOrEmpty(searchParams.GuestName))
txtGuestName.Text = searchParams.GuestName;
if (!String.IsNullOrEmpty(searchParams.CompanyName))
ddlCompanyName.SelectedValue = searchParams.CompanyName;
if (!String.IsNullOrEmpty(searchParams.CompanyType))
ddlCompanyType.SelectedValue = searchParams.CompanyType;
public interface IAudenceTab
{
bool ValidateSearch();
void InitializeSearch(ref RecipientSearchParams searchParams);
void LoadParamValues(RecipientSearchParams searchParams);
}
private void PopulateGuestSqlParams()
{
if (!String.IsNullOrEmpty(GuestName))
{
AddHashValue("GuestName", _GuestName);
Description += String.Format("Guest Name {0}; ", _GuestName);
}
if (!String.IsNullOrEmpty(CompanyName))
{
AddHashValue("CompanyName", CompanyName);
Description += String.Format("Company Name {0}; ", CompanyName);
}
if (!String.IsNullOrEmpty(CompanyType))
{
AddHashValue("CompanyType", CompanyType);
Description += String.Format("Company Type {0}; ", CompanyType);
}
public List<Person> ExecuteSearch()
{
PopulateSqlParams();
MSSqlDBProvider db = new MSSqlDBProvider();
SqlConnection conn = db.GetConnection();
List<Person> pList =
DataObjectProvider<Person>.GetObjectList("dbo.PersonNewsletterFilterSearch", CommandType.StoredProcedure,
pHash, conn);
return pList;
}
stored procedure used
(@GuestName IS NULL OR p.FullName LIKE '%' + @GuestName + '%') AND
(@CompanyName IS NULL OR p.ID IN (
SELECT Distinct compGuest.GuestId From CompanyGuest compGuest
Inner Join CompanyDetail compDetail on compGuest.CompanyId = compDetail.PersonId
where compDetail.[Name] = @CompanyName )) AND
(@CompanyType IS NULL OR p.ID IN (
SELECT Distinct compGuest.GuestId From CompanyGuest compGuest
Inner Join CompanyDetail compDetail on compGuest.CompanyId = compDetail.PersonId
where compDetail.[Type] = @CompanyType)) AND

View 2 Replies


Similar Messages:

Web Forms :: Changing The Textbox's Text Mode To Multiline The Textbox Becomes Resizable During Runtime?

May 3, 2010

When changing the textbox's text mode to multiline the textbox becomes resizable during runtime. I can't seem to find the property to disable this, does anyone know how I can resolve this issue?

View 4 Replies

Web Forms :: Textbox Text Not Changing On Button Click?

Mar 31, 2010

In my web page, i am retreiving values from database in textbox. I have one update button in that page when i change the textbox value and click on button the value does'nt change it is taking the same value. What is the problem i did'nt understand?

Code for retreiving Values from database:

[Code]....

Code for Updating on button click:

[Code]....

View 8 Replies

Web Forms :: Changing Backcolor Of Textbox When Input Is Invalid?

Feb 11, 2011

I have an ASP.net page with two textboxes where the user types in input. I applied a requiredfieldvalidator to both textboxes as well. However, I also want the textboxes to change to a backcolor of red if the form is invalid when the user clicks the button to submit the input. I tried this code below in tthe button click event, but doesnt work...

If Page.IsValid = False Then
txtCosts.BackColor = Drawing.Color.Red
txtRevenue.BackColor = Drawing.Color.Red
End If

How else can I change the Backcolor of the textboxes when the input is invalid.......

View 3 Replies

Web Forms :: Changing A Textbox Text Doesn't Change?

Dec 22, 2010

I am using a dataview to populate existing values on page_load:

[Code]....

The problem is, if i change that text, and click a button and check what the value of the text box is, it is still the original database populated value, not what i changed it to.

View 3 Replies

Web Forms :: Changing Textbox Color Base On Time Change?

Jan 31, 2010

i have 5 textbox in the webpage how to change the color to green and the word to open from 8 am gmt to 5pm gmt else the textbox will be red and the word will be closed

TextBox18.Text ( open 10:00 pm and close 7:00 am )(GMT)

TextBox19.Text ( open midnight and close 10:00 am )(GMT)

TextBox20.Text ( open 8:00 am and close 5:00 pm)(GMT)

TextBox21.Text ( open 7:00 am and close 4:00 pm )(GMT)

TextBox22.Text ( open 1:00 pm and close 11:00 pm )(GMT)

this the code that i useed

in page_load

[Code]....

it is not working right

View 8 Replies

Web Forms :: Client Side Custom Validator Changing Textbox Values?

Mar 19, 2010

I've been working on a task to add a validator to compare the values of two text fields in a ASP.NET 1.1 application.

It uses validators already, so the best approached seemed to involve a CustomValidator. I was inspired by the following example:

[URL]

I got the server side validation working - now I'm trying to add some client-side validation but I'm having a strange issue.

When I click in either of the two text fields, the value of the txtFinalGrade field is overridden to either "true" or "false". I've been having a tough time tracking down the code that's causing this. I tried using the IE Developer Toolbar to trace the script - as well as FireBug in Firefox (though this is an IE-only app) and I'm still trying to figure out what's causing this to happen.

Since I think this is a JavaScript issue, I'm posting that part of my code:

[Code]....

Anyone have ideas of things to try? Anyone have similar issues with textboxes being set to true/false when working with custom validators?

View 3 Replies

Forms Data Controls :: Changing A Textbox's Read Only Property Right Before Update On A Gridview

Aug 27, 2010

I have a gridview with a date field. I don't want the user to be able to type in their own date and mess up the format so I made the property readonly. That date is then set by a point and click interface. This is all working fine but when the user clicks update this field doesn't update because it's readonly. If i turn readonly off it works so is there a way to turn off the readonly property right before submit?

View 7 Replies

C# - Changing The Size Of Html.TextBox

Feb 13, 2011

I'm developing an ASP.NET MVC3 application using the new Razor view engine but I'm having some difficulty changing a TextBox so that it is multiline. So far all I've been able to find via google is that I need to set the multiline property to true, but I'm not sure how.

View code looks like this.

<div class="editor-field">
@Html.TextBoxFor(model => model.Body)
</div>

View 1 Replies

VS 2008 Changing Label To TextBox On Run Time

Mar 18, 2010

First, my code:

Code:
<asp:Table>
<asp:TableRow>
<asp:TableCell>Name:</asp:TableCell>
<asp:TableCell><asp:Label>John Doe</asp:Label></asp:TableCell>
</asp:TableRow>
</asp:Table>

I want to change the Label Control to a Textbox Control once I've triggered a Button.Click event. So my output will be:

Code:

<asp:Table>
<asp:TableRow>
<asp:TableCell>Name:</asp:TableCell>
<asp:TableCell><asp:TextBox>John Doe</asp:TextBox></asp:TableCell>
</asp:TableRow>
</asp:Table>

The label part is for display the information from the database. I'm using a button as a trigger to edit that label by changing it to a textbox and I'll be using another button as a trigger to save the changes made in the textbox and then changing it back to a label.

View 23 Replies

VS 2008 Textbox That Is Attached To Extender Text Is Changing To Type Name Here?

Jan 16, 2010

I am using the VS 2008. I m using the TextboxwaterMarkExtender,Its working,Suppose watermark text is Type Name Here,Suppose i type sonia in textbox,When i refresh the page,then in textbox that is attached to Extender text is changing to Type Name Here,I want that if I type in textbox sonia,when the page is refreshed & page comes back,sonia is still there in textbox.

Code:

[code]....

View 13 Replies

State Management :: Session Table Value Also Changing When Changing Any Coloumn Name?

Jan 10, 2011

The problem is when am assigning my session table value to newly created table and if now am changing any coloumn name then the session table value also changing.

But my question is am assigning Session value to newly created table so how should session value should be affected?

for refference in my application

sessionState
mode="InProc"

View 5 Replies

Web Forms :: Changing Win.app To Web.app

May 22, 2010

I have win.app page and want to change it to a web.app,how can I do that?is it possible?

for instance i want to transfer Data's in text boxes from Win.app to Web.app.

View 1 Replies

Web Forms :: VB Script To Obtain The Value Of The Textbox On Page Load To Pass To Another Textbox?

Dec 18, 2010

I have a text box on page load, loads a text value. I would like on the first instance of the page load for another textbox to equal to this value. As I have a gridview on the same page to update the textbox value does not get updated.

Essentially, if provide me with a VB script to obtain the value of the textbox on page load to pass to another textbox default value only on the same page.

View 4 Replies

Forms Data Controls :: Get Gridview Footer Textbox Value In Outside Textbox On Blur?

May 8, 2010

How To Get gridview Footer Textbox value in asp.net outside textbox on blur ....

View 5 Replies

Forms Data Controls :: Finding Textbox In Gridview / Find The Value Of The Before Textbox

Sep 28, 2010

I have a gridview with a template field column. In the edittemplate of that column i have a textbox. In the next column of the gridview i have a button. When i click the button i need to find the value of the before mentioned textbox. I do it like this:

gridview1.selectedrow.findcontrol("textbox1"). This sometimes work just fine and without a problem but sometimes it seems it can't find that control and throws a null reference object. The error it's random like i said, sometimes just work and other just don't work...

View 2 Replies

Web Forms :: Changing CSS Tag By Code?

Apr 13, 2010

I have been given by a designer the HTML show below. This is a menu which will be used in throughout our website in a master page. My worry is how can I handle de the different class used depending when the page is selected or not. Below when on the page the id is "bot_seleccionado" and when a page is not selected it is bot1.

[Code]....

View 2 Replies

Web Forms :: Drop Down Value Not Changing?

Jun 23, 2010

have two drop down list in my page. When i select one drop down, the value of second drop will change according to the value of first drop down. I don't want page refresh when i select my first drop down. So i use update panel but now when i select the value from my first drop down on the event of selectedindexchanged it will always shows me the default value and if i remove update panel it works perfectly but with page refresh. I don't know what is the problem. Values for both drop down is coming from database. Also i have done !IsPostBack in my page load but i don't know where is the problem..Please check the code below:

[Code]....

View 31 Replies

Web Forms :: Changing Primary Key Value

Jan 8, 2013

I want to experiment that can we change the primary key value

I am making a table Employee with Id as primary key and name as other columns

and another table salery with emp_id as foreign key and salary as another column

on windows form

on button 1 click data should be inserted on both the tables is it possible

or i have to save the employee table first and then salary table

is it possible to give temporary id in salary as -1 -2 -3 and after inserting data in employee table it should take that id and replace with this one.

View 1 Replies

Forms Data Controls :: Unable To Capture The Updated Value Of Texbox Within Gridview: TextBox TextNewQuantity = (TextBox)

Feb 4, 2010

I have been trying to achieve the following:

1-Allow the user to change the quantity in a textbox i.e // "txtQuantity"

2-capture the newly entered quantity i.e //int integerNewQuantity= int.Parse(textNewQuantity.Text);

3-update the database using the newly entered quantity i.e. //UpdateItem(data,integerNewQuantity)

Problem:1-I have not been able to capture the text i.e. the newly entered quantity i.e. the value entered in the text box "txtQuantity"

2-Hence the database is updated using the existing value and NOT the new value unless I make a constant assignment as below:

textNewQuantity.Text = "2"; When tested the assignment of any number correctly updates the database. see the c# code:

C# code: Version.1
protected void btnUpdate_Click(object sender, EventArgs e)
{
txtItemDescription.Text = txtItemDescription.Text + "from btnUpdate talking.."; [code]....

View 4 Replies

Forms Data Controls :: If And Else (Show The Textbox And Hid Textbox) Using Itemtemplate?

Jun 15, 2010

this is my asp code

<ItemTemplate>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="19%">TRANS. NO. </td>
<td width="1%">:</td> [code]...

if the ID is NULL in the database the table or the ITEM will be hide...

View 2 Replies

Web Forms :: Difference In Width Of Textbox And Password Mode Textbox

Apr 26, 2014

i have a page alignment issue on my page below,the application i have developed by ASP.NETthe problem is i have a  text box in this text box i have set the textmode in passwordmy problem is below,

ex:name =............ // normal textbox (width 168px)without using textmodepwd  =........     // textmode =password (width 168px)

the moment is it was working fine on firefox and chrome perfectlybut IE am getting the above alignment issueactually i was set the both text box width is 168pxif i removed the text mode in password text box then it was working fine for both browserbut when i set text box mode am getting the above issue.

View 1 Replies

Web Forms :: Code Behind File Changing?

Sep 26, 2010

I have a code behind file which has only a few placeholders and literal. The gridview control and others are added in real time according to program conditions. I noticed that once in a while th eprogram stopped working because the .aspx file is changed and some of the place holders disappeared - Why? (the bolded lines disappeared once in a while)

View 2 Replies

Web Forms :: Changing The Debugging Keys In Vs?

Apr 27, 2010

is it possible to change my debuging kyes instead of function keys..

because am using the laptop and always i have to press "fn" key to prss the f10 or f11

is there any solution ..or can i permanantly press the fn click event ?

View 1 Replies

Web Forms :: How To Redirect To New Url Without Changing The Current Url

Feb 6, 2010

Any traffic comes to a page through any URL like [URL] should be redirected to

[URL] however the URL in the address bar should not change.It should not show [URL]

How to acheive this?

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved