Web Forms :: What Would Be The Syntax In JavaScript To Search A Variable For The Word "alert"
Feb 24, 2011If I wanted to search a variable for the wrod "alert", what would be the syntax in javascript
View 2 RepliesIf I wanted to search a variable for the wrod "alert", what would be the syntax in javascript
View 2 Repliesprotected void saveMergedFile(string[] ReportFiles)
{
foreach (string item in ReportFiles)
{
[code]...
have the code...try
{
do something..
}
catch(Exception ex)
{
Response.Write("<script>alert('"+ex+"')</script>");
}
but the alert box is not displaying...if i use the code.
try{do some thing}
catch (Exception ex)
{
Response.Write("<script>alert("an error occur")</script>");
}
alert box appears....how could i can display the exception variable in alert box
I want a word search i doing the search like this , but it is giving character wherever there is in the string,if i give two character like ok it is searching for a full string where ever Ok is there select * from table1 where textfield like '%word%' this query would match word but also wordabc how can i make it aware of delimitions
View 3 RepliesI hv Writte nA sql Query in whic hi want to use an Inner join as well as THe left OUter Join in it ..i hv written it in the sql server it executes properly.but when i run the same code ..from my application .it starts gving the Error Incorrect Syntax Near Keyword INNER..
[code]....
How to search a word for spelling correction in c#. Below is the code which i used,
Its not working, for words less than three 5 letters.
public string _dictionary(string word)
{
string[] wordArray = new string[125896];
string reading;
int nwords = 0;
FileStream fs = new FileStream(@"C:Documents and Settingsharsha.limayeDesktopspelling.txt", FileMode.Open, FileAccess.Read);
StreamReader s = new StreamReader(fs);
while((reading=s.ReadLine())!=null)
{
if (reading == word)
return word;
char[] TextboxPos=reading.ToLower().ToCharArray();
char[] readingPos = new char[20];
readingPos = TextBox1.Text.ToLower().ToCharArray();
if (TextboxPos[0] == readingPos[0])
{
if(readingPos.Length<=5)
{
if (TextboxPos[1] == readingPos[1] && TextboxPos.Length-1 == readingPos.Length-1)//[readingPos.Length])// && TextboxPos[TextboxPos.Length-1] == readingPos[readingPos.Length - 1])
{
// return reading;
TextBox1.Text = "Search for " + reading + " instead of " + TextBox1.Text;
break;
}
}
else
{
if (TextboxPos[1] == readingPos[1]&& TextboxPos[2] == readingPos[2] && TextboxPos.Length == readingPos.Length && TextboxPos.Length-1 == readingPos.Length - 1&& TextboxPos.Length-2 == readingPos.Length - 2)
{
//return reading;
TextBox1.Text = "Search for" + reading + "instead of" + TextBox1.Text;
break;
}
}
}
wordArray[nwords] = reading;
nwords++;
}
fs.Close();
s.Close();
return reading;
I have a textbox and what I would like to implement is basically a situation similar to what you have in google when you type in a word. In otherwords,
in the textbox when you type in J, it should generate a list of names that starts with O in alphabetical order, then next when you type in o, so that now you have Jo, it should generate a list of names instead that now starts with Jo in alphabetical order, then again when you type in h, it should generate a list of names that starts with Joh and so on.
I can easily create a search that will allow a user to input a single word (or a portion of a single word) into a text box that will search a database column.
But what I want is for the user to be able to type two or three words into the textbox and produce results where just one of the words have to match the contents of the columns cell.
I don't need to be able to do a multi column or table search, and I'm using C# and MS Access.
I imagine this question would have been asked more than a couple of times - but I can't find a decent answer.
I have 1 aspx page with code behind. In this I have 1 button where I am using OnClick = "btnOk_Click" event. Now here I am testing some validation I want to give a alert/popup if validation failes. I know I can display message using Response.Write, but my user wants to display an alert.
View 7 RepliesI am using follwing code for alert message
ScriptManager.RegisterStartupScript(this, this.GetType(), "sp1", "alert('Employee id Exist')", true);
txtempid.Text="";
txtempi.Focus();
But it does not focus the txtempid text box.
How to set focus after alert box?
I have changepass.aspx page that in this page i have 3 textbox and 1 captcha
refer [URL] ....
I want when users enter their data correctly in message box show ="your password update" and if they enter wrong data in messagebox show="please enter oldpassword correctly"
So I use below code
protected void Page_Load(object sender, EventArgs e) {
if (Session["Message"] != null) {
this.ClientScript.RegisterStartupScript(GetType(), "Javascript", "<script>alert('Yur password update correctly.')</script>");
Session["Message"] = null;
} if (Session["MessageError"] != null) {
this.ClientScript.RegisterStartupScript(GetType(), "Javascript", "<script>alert('please enter old password correctly .')</script>");
Session["MessageError"] = null;
}
But when I enter data correct or wrong it didn't show any thing in message box
protected void Imgpass_Click(object sender, ImageClickEventArgs e) {
string data=Server.UrlDecode(Request.QueryString["Behcode"]);
SqlCommand _cmd=new SqlCommand("changepassword",_cn);
_cmd.CommandType=CommandType.StoredProcedure;
_cn.Open();
[Code] .......
I want to be able to make a query from three dropdownlists but not all three have to be selected to create results. This is what I have so far :
sub getdata (src as object, e as eventargs)
dim strsql as string
dim myconnection as oledbconnection
dim mycommand as oledbcommand
myconnection = new oledbconnection(ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_csrdb"))
strsql ="SELECT tbl_case.Case_id, tbl_case.Title, tbl_case.Description, Tbl_Country.Country_Name, tbl_principle.Principle_Name," _
& "tbl_keyword.Keyword FROM tbl_keyword INNER JOIN ((tbl_principle INNER JOIN (Tbl_Country INNER JOIN tbl_case ON Tbl_Country.Country_Id
tbl_case.country) ON tbl_principle.Principle_ID = tbl_case.Principle) INNER JOIN tbl_Usedkeywords ON tbl_case.Case_id
= tbl_Usedkeywords.case) ON tbl_keyword.Keyword_id = tbl_Usedkeywords.keyword " _
& "WHERE "
if DLPrinciple.selectedindex=0 then
strsql = strsql & "((tbl_principle.Principle_Name) like '%')"
else
if DLCountry.Selectedindex=0 then
strsql = strsql & "((tbl_country.country_Name) like '%')"
else
if DLKeyword.selectedindex=0 then
strsql = strsql & "((tbl_keyword.Keyword) like '%')"
else
strsql = strsql & "((tbl_principle.principle_Name) = '" & session("infoprinciple") & "')" + "((tbl_country.country_Name) = '" & session("infoland") & "')" + "((tbl_keyword.keyword) = '" & session("infokeyword") & "')"
end if
end if
end if
This is working perfectly with only one dropdownlist but I can not figure out how to make it work with several.
I have been alerted to the Query Extender control through previous posts, but I am still seeking the final part of my desired solution.
NB the following is written in conceptual English (programming specification) format, rather than actual asp code.
While I fully understand that I can use the QueryExtender control to pass a parameter from one web page to another, I do not see, and maybe this is not even possible, how I can pass a parameter of which field I want to select on.
Ideally I would like to be able to implement a query which is
SELECT tiles where 'Passed Variable Name' contains 'Passed Test Value'
such as would then generate, for example -
[code]....
I have only mentioned three in the concept above but there are actually about half a dozen different calling pages, and there could develop a few more over time.
i want to store a word documents (.doc) in the database and i need to provide search over a collection of Word documents and highlight the words too.
I m using VS2005 --> ASP.NET, C#.NET, SQL Server.
I am not that good in SQL syntax and need some help. I am trying to create some search functionality for my website. Basically it just has to search for product names. Now I have a simple statement like SELECT * FROM Products WHERE ProductName LIKE '%' + @ProdName + '%' This statement does not fit to my requirements.I have 2 issues:
1. Assuming someone searches for "blocks". The result that I get is product names with the word "blocks" in it, however I would also like to display results with product names the have the word "block" in it i.e without the "s" In short I want to match the possible product names from the keyword e.g block, blocks, blocking etc I dont want it to search the exact name but may be just partially. If the keyword contains the exact word from the product name, well and good but it should also display the products where the keyword is partially matching.
2. Assuming someone searches for the words "concrete blocks". I get the result with products that have the words "concrete blocks" only. But I would also like to get the result with say "Louvre Blocks" in the total results displayed.So can someone kindly help me sort out my issues. Sorry if im repeating words but im just trying to make an understandable point.
I've a problem with the listsearch extender.
My dropdownlist have serveral values with:
Companyname ----- City
Firstname ------- Lastname
The extender now search in the first word but is it possible to search also in the second word?
i have a button,i want when a button is clicked a alert message should be display, i wrote the code like this
protected void btn1_Click(object sender, EventArgs e)
{
Response.Write("<script>alert('Your account has been created')</script>");
}
It work well, but when it pop-up background color become gray,i want when it pop-ups,the background should remain same .
like when we click on button which is associated with confirmbuttonextender..the background become fade but it doesn't go blank..
can we grab a global variable or Session or View State variable in the javascript or using jquery?
I'm evaluating two options of accessing a server side data on client side. Little bit confused about the efficiency or may be you can call it as finding best approach to do it.
I need to access a server side data may be an integer value in javascript on client side. I know about two options to do it.Create a public variable or property on server side and set it to javascript variable on client side as below:
var value = eval(<% =value %>);
Create a asp hidden variable and set value in this hidden variable from server side and access it through javascript using document.getElementById().
Which is the best approach and what are the pros and cons?
i have table contain two column id and word .word column may contain one word or two or three ex ( computer , computer software , computer software computer )i want search the text if it contain any word in that table .
View 2 RepliesI need to have search form in my web app . I want visitor input text in textbox control and when he click on Search button it check DB table for his input text.
I dould like if user input "Windows 7" and I have the sentence in DB Records as "My be Some Windows Generation .." it list this record.
in other word I want to search for any word that users entered in DB.
Could any one tell me efficient way instead of split input text to words and then execute search query per word?
I have text box ...If i type in textbox like
"C,C++,ASP.net,4-5Years" then every word should be checked by database whether that name exits or not in table field of the database..It should be check separately of every word ..It just like Search engin...How can i do in asp.net
I am developing the Home page of a Client. Apart from various things on this home page I have a text box and search button. Having said that, I have a database in which I have almost 12 tables with varying number of columns. Now my question is,Is there anyway to search a word typed by a user in the textbox to search it in all the tables(all columns) of the database.
View 2 RepliesHow can I search a word in all the columns of a table?
View 4 Replieshow can i separate words in db column separated by enter key. I am entering data in a multi line textbox directly to db, and i want to search a word in that column. Since the words are seperated by enter key, how can i separate the words to search. If i use like i can't search the exact word is there..
View 2 Replies