|
Hi guys.
Ive a problem with my links.I have a link from my Default.aspx page to a html(Dreamweaver) file that goes like this Page.Response.Redirect("C:\Documents and Settings\kagisho.mashiloane\My Documents\Visual Studio 2005\Projects\Final Airliquide TelephoneList\Home Page\HomePage.html").
its not opening the page, and gives this error - Server Error in '/Final Airliquide TelephoneList' Application.
--------------------------------------------------------------------------------
HTTP Error 404 - Not Found.
--------------------------------------------------------------------------------
Version Information: ASP.NET Development Server 8.0.0.0
So, I also tried this - Page.Response.Redirect("HomePage.html") since I have the two files in da same folder but i still get this message.Ive tried configuring my IIS manager to allow dynamic pages but i cant see where the options is to change or add extensions so dynamic pages can display.
Ive tried a couple of things guys.Thanx in advance
kagiso
|
|
|
|
|
matjame wrote: Page.Response.Redirect("C:\Documents and Settings\kagisho.mashiloane\My Documents\Visual Studio 2005\Projects\Final Airliquide TelephoneList\Home Page\HomePage.html").
You won't be able to redirect like this, since file is not in some server. You should specify virtual path in Response.Redirect()
|
|
|
|
|
So, if I said Page.Response.Redirect("HomePage.html") it should work.
But I have tried that and it doesnt work either.I tried that before attempting this one.
Thanx anyways for your assistance.
kagiso
|
|
|
|
|
i have created class library project and i have written connection string to sql server in app.config file like
<configuration>
<appsettings>
<add key="ConnectionString" value="data source=tiger\sqlexpress;initial catalog=PBNNET; password=AS1FJHLI;persist security info=true;user id=PBN_Admin;">
now i want to use this project in web application. So i will add the DLL of this project in web application. But how can i read the connectionstring from app.config file in web application?
Please provide some code or guidance for it.
|
|
|
|
|
hi all,
I have ListBox with multiple item selection mode on. I have problem reading data after POSTBACK. I mean I do not know how to get selected value from Listbox if there are more then one selected Items.
Thanks
|
|
|
|
|
for(int i=0;i<=ListBox1.Items.Count-1;i++)
{
if ( ListBox1.Items[i].Selected )
}
|
|
|
|
|
Dim array(ListBox1.Items.Count) As String<br />
Dim i As Integer = 1<br />
<br />
<br />
For index As Integer = 1 To ListBox1.Items.Count - 1<br />
If ListBox1.Items(index).Selected Then<br />
<br />
array(i) = ListBox1.SelectedValue<br />
i = i + 1<br />
End If<br />
Next
|
|
|
|
|
I am trying to include a Javscript file in all of my pages using the following line, written into the section of my master page.
<script runat="server" language="javascript" src="~/Javascript/MAD.js"></script>
For some reason I get the following error
Parser Error Message: Cannot use 'javascript' because another language has been specified earlier in this page (or was implied from a CodeFile attribute).
Any ideas how I can get around this as I need the runat tag and the ~ root symbol to find the file from all directories.
Thanks
|
|
|
|
|
Just Remove runat="server" code
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
"as I need the runat tag and the ~ root symbol to find the file from all directories."
Did I not make that bit obvious enough?
Lose the runat tag and the ~ symbol means nothing a will never work. Sometimes pages are one folder level up sometimes two, sometimes three. Therefore I have to use the runat attribute.
|
|
|
|
|
You're right that you need the runat="server" for the ~ symbol to work, however it will never work like you want it to, because then it will be treated as server-side script. So another approach is recommended. One idea would be to use full url paths, which could be constructed in the codebehind. Like:
string webroot = Request.Url.ToString().Replace(Request.Path, String.Empty);
Page.ClientScript.RegisterClientScriptInclude("mad", webroot + "/Javascript/MAD.js");
|
|
|
|
|
Hi,
In my application i have a "asp:dropdownlist" control on whose selectedIndexChange event i need to call a javascript function.
But i get build error:Too many characters in character literal.
If i remove 'runat=s"server" then its doesn't give build error, but on load of page, it doesn't show the control.
<asp:DropDownList runat="server" ID="ddListSelect" EnableViewState="true" CssClass="ddListStyle"
style="z-index: 102; left: 384px; position: absolute; top: 40px" Width="117px"
OnSelectedIndexChanged="javascript:openPopupNew('frmPopup.aspx')" >
<asp:ListItem Value="Spain">Spanish</asp:ListItem>
<asp:ListItem Value="Turkey">Turkish</asp:ListItem>
<asp:ListItem Value="England">English</asp:ListItem>
</asp:DropDownList>
What can i do get rid of the build error, n for the javascript code to get executed successfully?
Could anyone plz help?
Thanks
|
|
|
|
|
use onClick event instead of OnSelectedIndexChanged
Best Regard
Pathan
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
there is no 'onclick' event for an "asp:dropdownlist"
and i need to show popup when user selects an item from the dropdownlist only..not on click of dropdownlist
|
|
|
|
|
The OnSelectedIndexChanged is server event and not suitable for your purposes. The client-side event you are looking for is onchange . So in the codebehind write:
ddlListSelect.Attributes.Add("onchange", "javascript:openPopupNew('frmPopup.aspx')");
|
|
|
|
|
Thanks
|
|
|
|
|
Hi
I am developing a application in asp.net.My database table contain some
candidate information.Suppose it contain candidate educational information
in datagrid i am showing a its graduation information and i am bound that
column and my table contain its post graduation information.If table contain
candidate PG information then i want to show its PG information below the
row of graduation.Means first row in datagrid conatin its graduation info
and if table contain its PG info then i want to show its PG info to tne next
row.how can i do this.i am able to add education info datagrid but i am trying
show its PG then its come in a single row.I want to show it below to first
row.How can i do this.
Rahul
|
|
|
|
|
if you just want to only show records(not 4 editing) to user then give me db query
|
|
|
|
|
Yes i want to show only 4 record in one row in table contain its pg information then this information should add below next row. my data database query is as below.Its not for editing.
str = "select BachlorDegree,B_Grade,B_PassingYear,B_Institute,LangKnown from EducationalInfo where UserId=" & cndid
this shows first 4 column.
Rahul
|
|
|
|
|
if u r trying to get only one candidate record of Grd and PGrd from 2 different tables and show it to grid then try this type of logic
dtGrd (this table contains Graduation info agiant CandidateID)
dtPGrd (this table contains PG info agiant CandidateID)
dt (this table contains that columns which u want to show from both ur above tables)
dim dr as DataRow<br />
<br />
if dtPGrd.rows.count>0 then<br />
<br />
dr=dt.NewRow<br />
dr.item("ColumnName")=dtPGrd.rows(0)("ColumnName")<br />
dr.item("......<br />
<br />
dt.rows.add(dr)<br />
<br />
end if<br />
<br />
<br />
if dtGrd.rows.count>0 then<br />
<br />
dr=dt.NewRow<br />
dr.item("ColumnName")=dtGrd.rows(0)("ColumnName")<br />
dr.item("......<br />
<br />
dt.rows.add(dr)<br />
<br />
end if<br />
<br />
Grid_View1.DataSource=dt<br />
Grid_View1.DataBinding()
if u want to do this for many candidate then use this logic in lop
Hope it's helpfull for you
Basharat
|
|
|
|
|
Thanks.
i am trying it.
df
|
|
|
|
|
hiii i need an applcation which would give an option to store the search result-columnnames in an xml file and use the xml file for future purpose for retriving the values using that xml file containing the column names....
I wud be very thankful if anyone help me out as i am newbie in .net
sharru4allin@gmail.com
|
|
|
|
|
I have the following function writen in asp.net with vb script. when click the update button everthing is getting updated except "date" I tried to update using date.parse also but no use. The same code was woking fine previous say a week back. I have not made any changes also. But I am not finding any reasons for this. this is happening whereever i have used date. Insertion or updation of date and searching based on date is not working.
Function update()
Dim flag As Boolean
flag = False
Dim tran As SqlClient.SqlTransaction
Dim a As String
a = txtexpdate.text
Dim d As Date = Date.parse(a)
If txtremark.Text.Trim = "" Or lblcustname.Text.Trim = "" Or txtcustdrno.Text.Trim = "" Or txtbore.Text.Trim = "" Or txtstroke.Text.Trim = "" Or txtapplication.Text.Trim = "" Or txtrod.Text.Trim = "" Or txtpress.Text.Trim = "" Or txteqpmodel.Text.Trim = "" Then
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Fields can not be left blank !"
Exit Function
ElseIf IsNumeric(txtbore.Text.Trim) = False Or IsNumeric(txtstroke.Text.Trim) = False Or IsNumeric(txtrod.Text.Trim) = False Or IsNumeric(txtpress.Text.Trim) = False Then
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Bore,stroke,rod and working pressure should have numeric value !"
Exit Function
Else
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
Dim comm As New SqlCommand()
comm = dbconn.CreateCommand
tran = dbconn.BeginTransaction
comm.Transaction = tran
Try
comm.CommandText = "update D_proposal set cust_drw_no='" & txtcustdrno.Text.Trim & "',cust_name='" & lblcustname.Text.Trim & "',typ_cyl='" & txttypcyl.Text.Trim & "',cushioning='" & txtcush.Text.Trim & "',bore='" & txtbore.Text.Trim & "',stroke='" & txtstroke.Text.Trim & "',application='" & txtapplication.Text.Trim & "',category='" & txtcat.Text.Trim & "',sada='" & txtsada.Text.Trim & "',rod='" & txtrod.Text.Trim & "',wrk_press='" & txtpress.Text.Trim & "',eqp_mdl='" & txteqpmodel.Text.Trim & "',mounting='" & txtmounting.Text.Trim & "'where pno='" & lblpno.Text.Trim & "'"
comm.ExecuteNonQuery()
'comm.CommandText = "update D_task_det set associate='" & txtassociate.Text.Trim & "',exp_date='" & txtexpdate.Text.Trim & "',remark='" & Replace(txtremark.Text.Trim, "'", "''") & "' where pno='" & lblpno.Text.Trim & "'and task='" & lbltask.Text.Trim & "'and leader='" & txtleader.Text.Trim & "'and revision='" & txtrevista.Text.Trim & "'and reassign='" & txtreassigsta.Text.Trim & "'and hold='" & txtholdsta.Text.Trim & "'"
comm.CommandText = "update D_task_det set associate='" & txtassociate.Text.Trim & "',exp_date='" & d & "',remark='" & Replace(txtremark.Text.Trim, "'", "''") & "' where pno='" & lblpno.Text.Trim & "'and task='" & lbltask.Text.Trim & "'and leader='" & txtleader.Text.Trim & "'and revision='" & txtrevista.Text.Trim & "'and reassign='" & txtreassigsta.Text.Trim & "'and hold='" & txtholdsta.Text.Trim & "'"
comm.ExecuteNonQuery()
tran.Commit()
flag = True
lblstatus.Visible = True
lblstatus.ForeColor = Color.Green
lblstatus.Text = "Successfully updated !"
Catch ex As Exception
tran.Rollback()
lblstatus.Visible = True
lblstatus.ForeColor = Color.Red
lblstatus.Text = "Transaction failed !" '+ ex.ToString
Finally
comm.Dispose()
dbconn.Close()
End Try
Return flag
End If
End Function
Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
update()
End Sub
Chaitra N
|
|
|
|
|
What is your date column datatype in Database ? Have you tried running the same query in query analyzer ? If so what error you got ?
|
|
|
|
|
Now it is working. I have changed the enableviewstate property of all the controls to true and readonly property of datetextbox(text boxes where we have date value) to false. But i want datextbox readonly. What can I do for this?
Chaitra N
|
|
|
|