|
Hi,
I am creating an web application in asp.net and the requirement is that I have to hide a FileUpload or INPUT(File) on button click using JavaScript . I tried a lot but I didn't get the success . Please help me regarding this. Thank You
|
|
|
|
|
Put it in a div and hide that. Do you know how to hide a control with js at all ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Sorry.... But I don't know how to hide controls in js. So I also don't know how to hide it through put it in <div>.
|
|
|
|
|
astrovirgin wrote: But I don't know how to hide controls in js
Do you know how to google? if no, CG's article[^] should help.
to toggle the visibility follow these steps,
1 - Get the div using document.getElementById(divId)
2 - Set style.display = 'none' to hide and style.display = 'block' to show.
|
|
|
|
|
in vb i hv done following.......
trWorkAssigned.Style("Display") = "Inline"
tdUpdtInvCoid.Style("Display") = "none"
i want to use tht coding in c#
how i will use tht?
|
|
|
|
|
Replace () with [].
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
trWorkAssigned.Style.Add("Display", "Inline");
tdUpdtInvCoid.Style.Add("Display", "none");
i hv use like this...
is tht right?
|
|
|
|
|
That works too.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
which one method will be used in vb.net to play media file i.e(sound1.mp3 ) passed as parameter to that method
|
|
|
|
|
You embedd WMP in your page as an activeX object.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
hi,
To play a media file u can make use of 'Embed' control.
set src property of embed tag to path of the file then it will play.
regards,
|
|
|
|
|
Hi all,
iam not able to figure out what i have to do for displaying related record details inside formveiew on linkbutton click . i have added seperate linkbutton for each reservation and wants to display record details inside formview but problem is that only single record is displaying on all linkbutton clck
i have seven records in table .
here is my code
sqlcmd.CommandText = "Select Reserve_ID from Reservedvehicle"
sqlcmd.Connection = sqlconn
Dim sqlrdr As SqlDataReader = sqlcmd.ExecuteReader
While sqlrdr.Read()
Dim tblcell As TableCell = New TableCell()
Dim tblrow As TableRow = New TableRow()
Dim lnk As New LinkButton
lnk.Text = "click here for details "
lnk.CommandArgument = (sqlrdr("Reserve_ID"))
'add Click functionaliuty
AddHandler lnk.Command, AddressOf OnClickLink
tblcell.Controls.Add(lnk)
tblrow.Cells.Add(tblcell)
Table1.Rows.Add(tblrow)
End While
sqlrdr.Close()
Here is event handler :
Protected Sub OnClickLink(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
Dim lnkbutton As linkbutton = sender
Dim param As String = e.CommandArgument
FormView1.Visible = True
Dim myConnection As New SqlConnection("Server=localhost;Database=Reservation;uid=sa;pwd=server")
Dim ad As New SqlDataAdapter("SELECT * FROM reservedvehicle ", myConnection)
Dim ds As New DataSet()
ad.Fill(ds)
FormView1.DataSource = ds
FormView1.DataBind()
End Sub
can any body guide me what i have to do to reslove this issue .
Best Regards
Rameez
|
|
|
|
|
DetailView/FormView are designed to show single record at a time. User GridView instead.
|
|
|
|
|
Hi,
U hv properly coded but while retrieving data from Db to binding Formview u r not sending the Command Argument(Reserve_id) to Db.If u send that u can retrieve particular record based on reserve_id
|
|
|
|
|
Though DetailsView/FormView displays one record at a time, you may enable paging for these controls.. Thus user can navigate and view all the records, but one at a time.
|
|
|
|
|
Hi all,
I have a problem right now. I want to make a dll with one or two functions. Than i want to deploy that dll on my applications client machines for security purpose. when a machine having that dll will try to browse my applicaation, first i will call a method from the dll that is present on the machine. if i got the response than i will allow that machine to check my application.
I have already browsed Richard Birkby article, but he didn't explain about invoke.dll and how to run the application.
See if someone can help me.
Thanks
Faisal
|
|
|
|
|
You can write a .NET, ActiveX or Java control which runs on the client. You can't just deploy a dll to your client machine and run it from your web app.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I think for that activex i don't need to install framework or any other installation on client machine??
|
|
|
|
|
You should install that activex control. It works on client side.
|
|
|
|
|
Hi all,
iam not able to figure out what i have to do for displaying related record details inside formveiew on linkbutton click . i have added seperate linkbutton for each reservation and wants to display record details inside formview but problem is that only single record is displaying on all linkbutton clck
i have seven records in table .
here is my code
sqlcmd.CommandText = "Select Reserve_ID from Reservedvehicle"
sqlcmd.Connection = sqlconn
Dim sqlrdr As SqlDataReader = sqlcmd.ExecuteReader
While sqlrdr.Read()
Dim tblcell As TableCell = New TableCell()
Dim tblrow As TableRow = New TableRow()
Dim lnk As New LinkButton
lnk.Text = "click here for details "
lnk.CommandArgument = (sqlrdr("Reserve_ID"))
'add Click functionaliuty
AddHandler lnk.Command, AddressOf OnClickLink
tblcell.Controls.Add(lnk)
tblrow.Cells.Add(tblcell)
Table1.Rows.Add(tblrow)
End While
sqlrdr.Close()
Here is event handler :
Protected Sub OnClickLink(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
Dim lnkbutton As linkbutton = sender
Dim param As String = e.CommandArgument
FormView1.Visible = True
Dim myConnection As New SqlConnection("Server=localhost;Database=Reservation;uid=sa;pwd=server")
Dim ad As New SqlDataAdapter("SELECT * FROM reservedvehicle ", myConnection)
Dim ds As New DataSet()
ad.Fill(ds)
FormView1.DataSource = ds
FormView1.DataBind()
End Sub
can any body guide me what i have to do to reslove this issue .
Best Regards
Rameez
|
|
|
|
|
Hi,
How can we databind an HTML Input type Text control? I'm using a DHTML calendar in my formview's EditTemplate and this calendar needs a HTML text control, not an ASP.NET TextBox server control. But I cannot bind my Input text which get a date from user because it doesn't accept the Bind() method.
Any idea what I'm doing wrong here?
Regards,
Blumen
|
|
|
|
|
Can any one tell me the jscript code function in asp.net for validating text box like....
1)removing first space
2)adjusting middle space by single one
3)not copy text from textbox
4)e-mail validation
which used in inline code.
<asp:TextBox ID="TextBox1" onkeypress="myfunction();" runat="server"></asp:TextBox>
Thanks in Advance
Amol
<div class="ForumMod">modified on Tuesday, September 16, 2008 2:24 AM</div>
|
|
|
|
|
<!-- first: set causesValidation attributon to your controls to true
second: for each control add a requiredFieldValidator
third: set the validationGroup attribute for the button to Group1
-->
<asp:TextBox ID="txtBox1" runat="server" CausesValidation="true" OnTextChanged="txtPrefix_TextChanged" ></asp:TextBox>
<asp:TextBox ID="txtBox2" runat="server" CausesValidation="true" OnTextChanged="txtPrefix_TextChanged" ></asp:TextBox>
<asp:RequiredFieldValidator ID="reqPrefix" runat="server" ErrorMessage="Enter Prefix" ControlToValidate="txtBox1" ValidationGroup="GROUP1" > </asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="reqPrefix" runat="server" ErrorMessage="Enter Prefix" ControlToValidate="txtBox2" ValidationGroup="GROUP1" > </asp:RequiredFieldValidator>
<asp:Button ID="btnValidatePart" runat="server" Text="Validate" ValidationGroup="GROUP1" EnableViewState="true" OnClick="btnValidatePart_Onclick" />
xxx
|
|
|
|
|
i am a beginner in asp.net so can u give me solution for jscript file i.e. call jscript function in .aspx file without press any buttoni.e.submit or ok button
only call it like keypress event or like for in text box no key active for any keypress event
<asp:textbox id="TextBox1" runat="server" onkeypress="return NoKeyPress(this);" xmlns:asp="#unknown">
thanks in advanced
amol
|
|
|
|
|
I could not find a pictureBox icon in the toolBox. Therefore,
how do I create a picturebox control at run time.
Thank You, Signed Linda
xxx
|
|
|
|