|
System.IO.File.Exists(Server.MapPath("..\Reports\XML\FileName.txt")) Return's a Boolean
|
|
|
|
|
hai all,
my doubt is something abt Javascript .
in my webform i ve a datagrid with in that datagrid i ve two textbox in the 1st and 3rd column.
how i retrive its value in a javascript .
i know to take value of a cell in the datagrid using javascript.
document.getElementById("dgQtion").rows(1).cells(5).innerText
how i take the value of a textbox in first row cells(1)?
OR
i am using vb.net.i want to pass its value(textbox inside datagrid) to a javascript function.
i know to pass the value of a cell in the datagrid to javascript.
in itemdatabound event i can take the value of a textbox which is inthe datagrid.
CType(e.Item.FindControl("TxtRate"), TextBox).Attributes.Add("onKeyUp", "javascript: return calculate(this.value," & e.Item.Cells(0).Text & ");")
instead of e.Item.Cells(0).Text i want to pass the value of a textbox, which is inside the datagrid , to javascript function calculate.
any solution is appreciatable.
tahnks in advance
All I ever wanted is what others have....
CrazySanker
|
|
|
|
|
+ The simple way to know the id of the textbox at the client side is to view source the web page. Or you may want to look at the ClientID property from the server side code.
+ Also, to pass the value of the TextBox from the server side, you first need to get reference to the TextBox control like you are doing in the ItemDataBound, then you simply access the Text property of the control.
|
|
|
|
|
hi there ,
I'm a beginner in programming using ASp and vb.net and sql server 2000 and I'm facing a problem of how to store and retrive the image from ms sql server databse , I need to know the following things :
1.using html file feild control in asp how do I code on submit button so the specified file will be stored in database as well as in some specified folder for a particular entry .
2.how do i retrive this image from my database and view I require the query .
I need help so who can help i will be very thankful to him|her.
S.Mohamed Radhi
|
|
|
|
|
|
I have seen this link before but i'm still unable to code that could you plz send me the link of another example based on vb.net if you can I would be very thankful to you
|
|
|
|
|
If you can't read this example and use it for your code then another won't do you any good either.
only two letters away from being an asset
|
|
|
|
|
Greetings!!!
I have a problem, my web aplication has a Master Page and other page what inherits from the master page. The Master page has a treeview control and a herder. When a choose an option in a node from the treeview it displays the page but the postback appears in the selected page y also in the master page, and then the state of the treeview dissapears.
Waht can i do for avoid the postbak in the master page?
DIEGO
|
|
|
|
|
remove the MyBase.OnLoad from the MasterPages's VB File, if its not being used.
|
|
|
|
|
Ok, it would be a solution, but in the Load event there is the code for loading the treeview, if i use Atlas for ASP.NET ?
Thanks
|
|
|
|
|
I apoligize. I'm not familiar with Atlas for ASP.NET. I'll reasearch my responses better next time.
|
|
|
|
|
Ok, no problem and Thank you for your help.
|
|
|
|
|
Hey AreJay,
Try to implement client callback-enabled type tree view so that you wouldn't need to post back each time you select a node... AND you can find one right out of the box at this website!
http://www.obout.com
-Nila
Nila Fridley
|
|
|
|
|
Rhlye wrote: Waht can i do for avoid the postbak in the master page?
The MasterPage in its nature is a user control which is then combined with the content page to produce the entire web page. So when a postback occurs, the whole web page is reloaded including the contents, header and the treeview control in the masterpage. In this case, if you only want to reload the contents, but the master page part, you may have a couple of options which you can consider:
+ Use frame (or iframe) like you see the online MSDN library web site.
+ Use Atlas (or Ajax in general) to dynamically load the output markup of the content web page only, then attach it to the current document at the client side.
|
|
|
|
|
Hi there
I'm working whit Visual Studio 2005 developing an ASP.NET 2.0 WebPage
I have a DropDownList Control with 2 options to select. I want to generate a validation message according to the selection made in the DropDownList Control. Any ideas???
THANX ¡¡
|
|
|
|
|
Server-side or client-side?
|
|
|
|
|
|
<br />
Sub DropDownList_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles DropDownList.SelectedIndexChanged<br />
Dim script As String = ""<br />
Dim ctrl As DropDownList = CType(sender, DropDownList)<br />
If ctrl.SelectedValue = "something" Then<br />
' Some Kinda Validation occurs<br />
script = "alert('This is what was selected: " & ctrl.SelectedValue & "');"<br />
Else<br />
' Some Kinda Validation occurs<br />
script = "alert('This is what was selected: " & ctrl.SelectedValue & "');"<br />
End If<br />
Me.ClientScript.RegisterClientScriptBlock(Me.GetType, "Alert", script, True)<br />
End Sub<br />
Is this what you had in mind?
|
|
|
|
|
just an fyi- make sure you provide the html control name when incorporating it within the script string... server controls sometimes take a different name once the result page is sent from the server back to the client.
Now, why would anyone be interested in server-side validation? Postbacks are very inefficient! To validate without making round trips to the server, look into using validation controls such as RegularExpression or CompareValidator.
Nila Fridley
|
|
|
|
|
I have created a report generator that creates an XML and passes it back to the browser as an Excel Doc. It works fine but the application lives within https and seems to kill the application with this error:
Microsoft Internet Explorer
Internet Explorer cannot download DataGrid.aspx from www.mysite.com.
Internet Explorer was not able to open Internet site. The requested site is either unavailable or cannot be found. Please try again later. This creates the XML based off user selection etc.....
Report_Gen.aspx
<br />
Dim dataDirPathXML As String = Server.MapPath("..\DataGrids\XML\")<br />
ds.WriteXml(dataDirPathXML & Session.SessionID & ".xml", XmlWriteMode.WriteSchema) <br />
Response.Redirect("..\DataGrids\DataGrid.aspx") <br />
This passes the XML back as Excel.....
DataGrid.aspx
<br />
Dim temp As String = Server.MapPath("XML\") & Session.SessionID & ".xml"<br />
If System.IO.File.Exists(temp) Then<br />
Dim streamReader As New System.IO.StreamReader(temp)<br />
Dim sBuilder As New StringBuilder(streamReader.ReadToEnd)<br />
Dim stringWrite As New System.IO.StringWriter(sBuilder)<br />
Dim htmlWrite As New HtmlTextWriter(stringWrite)<br />
Response.Clear()<br />
Response.AddHeader("content-disposition", "attachment;filename=" & Session.SessionID & ".xls")<br />
Response.Charset = ""<br />
Response.Cache.SetCacheability(HttpCacheability.NoCache)<br />
Response.ContentType = "application/vnd.xls"<br />
Placeholder1.RenderControl(htmlWrite)<br />
Response.Write(stringWrite.ToString())<br />
Response.End()<br />
End If<br />
I've been to the Server.MapPath("..\DataGrids\XML\") location and the xml is not being created.
What am I missing? I've tested this out-side the https and runs fine (local host or Live production server). Please any experiences with this kind of issue would be helpful.
|
|
|
|
|
+ Does the web page DataGrid.aspx support the https?
+ Does it work with the Server.Transfer method instead of the Redirect?
IMO, you don't need to redirect to a seperate web page as it only increases the round trip to the server, meanwhile you can put the code of the DataGrid.aspx in the Report_Gen.aspx which is accessible via https. If you want to reuse this code in multiple places, you simply wrap it up in a custom utility class.
|
|
|
|
|
Not sure what you mean
support the https And I've never used the Server.Transfer method. I'll do some reading on the Transfer to replace the redirect. Thanks!
|
|
|
|
|
Hi.. good day. I have a question, did anyone know how to display the date from database without the time. That's mean i have a textboxt in .aspx page, and i get the data from database n display it in textbox. Normally the date data will come with time. How to remove the time and only display out the date?Can anyone help me to solve the problem? Thanks...
Best Regards,
Pei Sun
|
|
|
|
|
textBox.text = myDate.ToShortDateString();
|
|
|
|
|
Thanks..
Best Regards,
Pei Sun
|
|
|
|