Home ProgrammingASP.NET Opening a Webpage according to Textbox Value

Opening a Webpage according to Textbox Value

by John Bhatt
435 views
Hi,

Today I am going to tell you, how to Open a Web Page according to TextBox Value in ASP.NET. You can implement same in Plain HTML Page. This will use a Simple JavaScript Function which we will create according to our need.
Lets Look at the Code. We are using ASP.NET Ajax AutoCompleteExtender for more enhancement in Code (This will only work in ASP.NET).
Code for ASPX Page (HTML Design Part – ASP.NET)

 




If you are using Plain HTML, Just use this code.

 

Now JavaScript Code which is Inserted Directly in Head Section. (JavaScript)


Now code for C# page if you are using AutoComplete Extender.

[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]

public static string[] GetCompletionList(string prefixText, int count, string contextKey)

{

string[] Brands = { "hp", "acer", "dell", "lenovo" };

return (from m in Brands where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();

}

Enjoy…

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Opening a Webpage according to Textbox Value

by John Bhatt time to read: 1 min
0