|
Thanks for posting that link as its somthing im currently working on.
I also found this article
on the subject very helpful and it also contains VB code to do the same kind of thing (though I am working in C#).
One problem I have at the moment, along these very lines, that I was hoping to get help on is:
I have a menu dymanicly generated from an XML file, formatted with an XSL then displayed as an inline list using the ASP.NET XML tool and CSS.
I want to be able to call my <%EncryptQueryString()%> from within the XSL for-each loop, that is used to populate the HTML list. So that the querystrings in my menu http links cant be seen with a mouseover or viewing the source or in the url bar....
Becuase the menu is generated dynamicly the encryptquerystring and its parameters need to be called and set dynamicly also ... within the XSL for-each loop seemed the neatest way of doing this though i am stuggling to find any resources on getting <%%> tagged script to work under XSL.
So many thanks in advance if anyone can help me on this
|
|
|
|
|
Hey,
Regarding your problem i think it can besolved by assigning the xml source of your control at runtime, so in the code behinde you generate the XML source with all the querystring encrypted and whatever, then you can assign this XML document to the XML /XSL .NET control and you will be ready to Go.
Please let me know if this makes sense to you.
Moe Tarhini
Senior Software Engineer
http://profoundway.blogspot.com
|
|
|
|
|
Hi guys !
I am trying to search my database with some value enterd by the user in a textbox.The search result has to be displayed in a ListBox on click of search button.
The problem is that when i use the LIKE predicate with 'A%' it gives all the values in ListBox but when i use LIKE predicate as LIKE '"+TextBox1.Text+"' the result is not shown and i get an error saying one or more Parameters are not given values.
PLease Please PLease Help me guys !
My code snippet is as follows:
void Search_Click(object Source, EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
// ....Intializing the Strings....//
tring connectionstring;
string queryString;
DataSet ds = new DataSet();
OleDbConnection dbconnection;
OleDbDataAdapter ad;
connectionstring = "Provider=Microsoft.Jet.OLeDb.4.0;DATA SOURCE=" +
Server.MapPath("\\Database\\New_Tool.mdb") ;
queryString = "SELECT Company_Name FROM CompanyName WHERE Company_Name LIKE '"TextBox1.Text"' ";
dbconnection = new OleDbConnection(connectionstring);
dbconnection.Open();
ad = new OleDbDataAdapter(queryString, dbconnection);
ad.Fill(ds,"Company_Name");
ListBox1.DataSource = ds;
ListBox1.DataTextField = "Company_Name";
ListBox1.DataValueField = "Company_Name";
ListBox1.DataBind();
}
}
Vinay Chugh
Newbie in ASP.NET
|
|
|
|
|
Vinay Chugh wrote: queryString = "SELECT Company_Name FROM CompanyName WHERE Company_Name LIKE '"TextBox1.Text"' ";
The problem is in this line. In order for this to work you need to actually concatenate the content of textBox1.text with the sql string, not literally put the text "TextBox1.Text" within the string.
queryString = "SELECT Company_Name FROM CompanyName WHERE Company_Name LIKE '" + TextBox1.Text + "' ";
However, that said you should really get in the habit of using Parameterised queries, which allows you to just put a placeholder in the string
queryString = "SELECT Company_Name FROM CompanyName WHERE Company_Name LIKE '@SearchString'";
and then use the Parameters collection on the Command .
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hi ! J4amieC
Thanks for ur reply. I used the query:
queryString = "SELECT Company_Name FROM CompanyName WHERE Company_Name LIKE '" + TextBox1.Text + "' ";
But this also doesnt work.And no error has appeared too. It just refresh the page but with no output in ListBox.I will be obliged if u could tell me some solution to this prob as my project is totally struck bcoz of it & i am new in ASP.NET.
Also i dont know the concept of Parameterized query and their usage. I will be thankful i u could send me some link where i can learn the concept.
|
|
|
|
|
i retrievd the values from One.txt to a textbox(multi line,txtEditFile.Text )
i changed the values in text box and when i can click on save button the text should be updated in One.txt file
and the code is
StreamWriter strmEditWrite;
// Delete the file.
//strPath=C:\Inetpub\wwwroot\WebTextEditor\kiran
//strfile=One.txt
File.Delete(strPath + strFile);
// Create the file with new text.
strmEditWrite = File.CreateText(strPath + "\\" + strFile);
strmEditWrite.Write(txtEditFile.Text);
strmEditWrite.Close();
but iam getting an error acces denied plz help me out
|
|
|
|
|
To solve access denied problem.for the folder kiran ,in properties ->security add "everyone" and give full control
|
|
|
|
|
Can somebody tell me how to detect whether the printer is installed or not to the computer programically?
|
|
|
|
|
|
i would like to develop a web part that makes users acknowledge that they opened a document. the web part is for use on the intranet, which is used to share documents and work on the same documents.
i need help on how to create the web part to enable acknowledgements
philpetszw
|
|
|
|
|
Hi
I am developing web application . It was working properly before i deleting few controls but now it is giving me error at run time see the error i am not getting that . all things are ok but why it is showing ?
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: The compiler failed with error code -1073741502.
|
|
|
|
|
I am printing a html table using javascript.the table has borders. While printing in the end of first page, the vertical line is not completed and in next page also the line is incompletely started. How can avoid this.
|
|
|
|
|
Hai All,
How can we call a codebehind function on onblur event of a control in asp.net 1.1?The control may be a web server control,html control,html server control or a web user control.
Actually, we can call a script function on such an event.But, how to call a codebehind one?
Or else, how to call a codebehind function from a javascript function?
Any suggestions?? Please welcome...
-Priya
|
|
|
|
|
|
Thanks a lot, it is helpful.
|
|
|
|
|
hi!
i m trying to build up a message board just like one i am placing this message using datagrid control.
can any body tell me how can i implement the tree structure used in this dicussion board and if there is any open source of it is available please send me the details
i m using asp.net(vb.net)
regards
shezi
|
|
|
|
|
Hi,
I have an ASP.Net web application. I added some projects in the solution as follows:
MyWebApp Solution
- OrderLogic project folder (contains .vb files only)
- http Project folder (contains aspx files)
When I try to configure the build option, I am able to set the OrderLogic project to Release build. But for the http project, it only has Debug build. There's not Release build. The platform only has ".Net" for selection as well.
How can I build the http project folder for Release build?
Regards
|
|
|
|
|
Set debug = "false" in the web.config file.
|
|
|
|
|
Tried that. doesn't work.
I'm not sure if my post is confusing. I have a picture to make my problem clearer, but I don't know how to upload pics in this forum.
Anyway, when I mention I can't set to release mode, I was referring to the following menu:
Build -> Configuration Manager
The "Configuration Manager" dialog will appear. Here you can set to Debug or Release mode rite? I can't set my http project to Release mode.
Thanks
|
|
|
|
|
paddyboyd wasn't very clear on why you should do that and what it accomplishes.
There is no release option in the configuration manager because that settings is not used for web projects. Instead it's the setting in web.config that decides the build mode for the project.
Change the setting in web.config, and it will be build in release mode.
There is still no release option in the configuration manager, but that is as it should be, as that setting is not used.
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa,
Thanks for your info. I understand now. One question thou. I am using Preprocessor flags in my code.
<br />
1 Protected Sub MyFunc()<br />
2 Dim nValue As Integer<br />
3 nValue = 1<br />
4 #If DEBUG Then<br />
5 nValue = 2<br />
6 #End If<br />
7 End Sub<br />
When I set debug="false" in my webconfig, will the DEBUG preprocessor be undefined and thus not compile line 5?
|
|
|
|
|
Yes.
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I am working on a datagrid update... when I click on edit, I can get the textboxes but when I make the changes and click on the update button, I still have the old items in there... .can someone help? here is the code for my update command:
string cursusname, niveau, plaats, start, end, dip, finance,pers_id, afdeling, cursusID;
cursusname = ((System.Web.UI.WebControls.TextBox)e.Item.Cells[5].Controls[0]).Text;
niveau= ((System.Web.UI.WebControls.TextBox)e.Item.Cells[6].Controls[0]).Text;
plaats= ((System.Web.UI.WebControls.TextBox)e.Item.Cells[7].Controls[0]).Text;
start = ((System.Web.UI.WebControls.TextBox)e.Item.Cells[8].Controls[0]).Text;
end= ((System.Web.UI.WebControls.TextBox)e.Item.Cells[9].Controls[0]).Text;
dip = ((System.Web.UI.WebControls.TextBox)e.Item.Cells[10].Controls[0]).Text;
finance= ((System.Web.UI.WebControls.TextBox)e.Item.Cells[11].Controls[0]).Text;
pers_id= ((System.Web.UI.WebControls.TextBox)e.Item.Cells[0].Controls[0]).Text;
afdeling= ((System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0]).Text;
cursusID= ((System.Web.UI.WebControls.TextBox)e.Item.Cells[4].Controls[0]).Text;
System.Data.OleDb.OleDbConnection conn = new System.Data.OleDb.OleDbConnection("Provider=sqloledb;Data Source=SQL_SERVER;Initial Catalog=Intra_STUDENT;User Id=student;Password=student");
string sql = "UPDATE P_Cursus SET " +
"CursusNaam='"+cursusname+"', " +
"Niveau="+niveau+", "+
"Plaats='"+plaats+"',"+
"StartDatum='" + start + "',"+
"EindDatum='" + end + "', "+
"Diploma='" + dip + "', "+
"Financiering='"+finance+"' WHERE personeel_id="+pers_id+" AND Personeel_filliaal_afdeling ="+afdeling+" AND cursus_id = "+cursusID+"";
System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand(sql,conn);
myCommand.CommandType = CommandType.Text;
conn.Open();
myCommand.ExecuteNonQuery();
conn.Close();
DataGrid1.EditItemIndex = -1;
DataGrid1.DataBind();
|
|
|
|
|
It's because you're not resetting the datasource of the gridview to the new updated dataset before binding.
|
|
|
|
|
Thanks alot... now it works..... but my problem is now with the delete function... it is a kind of trickey... it not firing...
|
|
|
|