i am developing an application using ASP.NET with C#.
in my application i have 4 textboxes. they are 1. Textbox1
View Complete Post
I have one drodownlist which show data based om textbox values...
Let us consider i have
Select Name from table1 where Type IN(@typ)
here @typ is textbox values
here for example textbox will have some thing like this L1,L2,L3..
How to filter Name based and shown in drodownlist based on this L1,L2,L3(on textbox)..
Help me in this
Hi People, How are you all doing?
I have 2 pages one is SearchPage & It has DropDowns, textboxes to specify the search criteria. From the search result the user is redirected to another page when he clicks the hyperlink in the search result where he fills in the information and again redirected to SearchPage. Now the SearchPage is posted back with no state i just want to retain the search criteria and display when user comes back. Please give me some suggestion how to get this done. I've used ViewState to save the values and check them in Page_Load but they are null.
Update: I've come up with this code. But the problem is The values are being retained but the Button_Click event is not being handled properly. When i Check the code even after this "DropDownList1.SelectedValue = Session["Name"].ToString();" DownList1.SelectedValue is EMPTY"" samw with DropDownList2 . please Suggest something
protected void Page_Load(object sender, EventArgs e)
DropDownList1.SelectedValue = Session["Name"].ToString()
i have a requirement to embolden/italicise the selected text in a textbox. the way it is implemented as is by using a js function which inserts <b> and </b> tags at the start and end of the selected text for bold, and similarly <i> and </i> tags at the start and end of the selected text for italics.
here is the code in c# (to add attributes to link buttons)
lkbBold.Attributes.Add("onclick", "AddHTMLTags('" + txtTitle.ClientID + "', 'B'); return false;");
lkbItalic.Attributes.Add("onclick", "AddHTMLTags('" + txtTitle.ClientID + "', 'I'); return false;");
the txtTitle is the id of the text box, which contains the selected text to be emboldend.
function AddHTMLTags(textBoxId, format)
var textComponent = document.getElementById(textBoxId);
var content = document.getElementById(textBoxId).value;
var content1 ;
var content2 ;
// For IE
if (document.selection != undefined)
var len = document.selection.createRange().text.length;