|
hi,
In web application ,I have to open Print dialogue box on click event of button so that print out can be drawn of a page by user.
How can i achieve it?
Please Guide .
yog
hui gfgh kgdgrt njjn hjgkn
|
|
|
|
|
Hi,
call javascript function when button click.
In the javascript function write window.print().
Regards,
Pavan.
|
|
|
|
|
hi everyBody,
i hav made an control which is submiting a form and data into database,
dis control is used in an myform.aspx page and dat page is working fine in mozila
but not working in internet explorer. i think some thing is blocking javascript, when form is run in internet explorer, the click event of submit button does't work but work fine in mozila.
following code i m using:
control code :
--------------------------
<%@ Control Language="vb" AutoEventWireup="false" Codebehind="testControl.ascx.vb" Inherits="my.testControl" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<asp:textbox id="TextBox1" runat="server">
<asp:requiredfieldvalidator id="RequiredFieldValidator1" runat="server" errormessage="RequiredFieldValidator"
="" controltovalidate="TextBox1">
<asp:regularexpressionvalidator id="RegularExpressionValidator1" runat="server" errormessage="RegularExpressionValidator"
="" controltovalidate="TextBox1" validationexpression="^([a-zA-Z0-9_ ,]{1,120})$">
<asp:textbox id="TextBox2" runat="server">
<asp:requiredfieldvalidator id="RequiredFieldValidator2" runat="server" errormessage="RequiredFieldValidator"
="" controltovalidate="TextBox2">
<asp:regularexpressionvalidator id="RegularExpressionValidator2" runat="server" errormessage="RegularExpressionValidator"
="" controltovalidate="TextBox2" validationexpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
<asp:button id="submit" runat="server" text="Button">
-------------------------------------------------------------------------------
this is my aspx page where control is called:
<%@ Page %>
<%@ Register TagPrefix="My" TagName="Test" Src="~\allControls\testControl.ascx" %>
<title>Application
<body
<form runat="server">
<my:test id="myTest" runat="server">
------------------------------------------------------------------------
this is the click event of the sumit(button)
Private Sub submit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit.Click
If Page.IsValid Then
Dim strConn As String = Application("dbStrConn")
Dim MyConn_member As New SqlConnection(strConn)
MyConn_member.Open()
'transaction
Dim MyTrans As SqlTransaction = MyConn_member.BeginTransaction
Try
'Specify the first statement to run...
Dim MySql_member As String = "insert into test ([name],[email])values(@name,@email)"
'Create the SqlCommand object, specifying the transaction through
Dim cmd_member As New SqlCommand(MySql_member, MyConn_member, MyTrans)
cmd_member.Parameters.Add(New SqlParameter("@name", TextBox1.Text))
cmd_member.Parameters.Add(New SqlParameter("@email", TextBox2.Text))
cmd_member.ExecuteNonQuery()
MyTrans.Commit()
Catch ex As Exception
'Something went wrong, so rollback the transaction
MyTrans.Rollback()
MyConn_member.Close()
Throw 'Bubble up the exception
Finally
'Finally, close the connection
MyConn_member.Close()
End Try
End If
End Sub
this click event is working in mozila but not working in Internet Explorer.
thanx
RAHUL SIANI
|
|
|
|
|
You have to be more specific in your question.
Do you mean how many classes there are in the .NET framework? Do you mean how many objects there is available in the Page class? Do you mean how many object instances you can create?
---
b { font-weight: normal; }
|
|
|
|
|
if my application session time out , then i what to redirect the page to HOME
page. how its possible?
|
|
|
|
|
test a relative fixed session value such as the user id logged on for null.
if(session["userId"] == null)
then {
//redirect
}
|
|
|
|
|
I publish one of windows application using VS 2005. But I can not install this application in another PC. I tried several times but it cames following error message. "This file is not trusted....." like this.
how to handle this problem.Please help me to sort out this prob....
Regards,
Nawa
|
|
|
|
|
Hi,
I know already how to upload file in asp.net. Kindly teach me now, how I am going to view/retrieve file that I have uploaded.
Need your expertise.
Thanks in advance.
|
|
|
|
|
Hi,
If you want to retrive the uploaded file.... use anchor tag and place the file path in the href attribute of the achor tag.
<a href="uploads/myfile.doc">My File</a>
Regards,
Pavan.
-- modified at 4:37 Monday 20th November, 2006
|
|
|
|
|
That depends on the type of the file, for example if u uploaded an image and u wantto display it u add an image tag to your webform and fill the ImageUrl property with the path of the image u saved on ur web server and so on
Best Regards
3ala2
|
|
|
|
|
My file types are usually doc or excel files. How I will handle it? Thanks
|
|
|
|
|
what do u want to do with them?
download them?
Best Regards
3ala2
|
|
|
|
|
There is an option to download or for viewing. Thanks in advance.
|
|
|
|
|
where did u save the path of the uploaded folder?
Best Regards
3ala2
|
|
|
|
|
Hi.. I save the uploaded files at C:\Inetpub\wwwroot\Test\Data
|
|
|
|
|
i c
google something about server.mappath
u can create a hyperlink and make the href property as the "virtual path" for ur file
this way it will prompt downloading when u click on it
Best Regards
3ala2
|
|
|
|
|
Hi my friends , i am doing my senior project on developing a dinamic web site which comprises chat and forum program.And i am doing it using ASP.net. Now i have to know about socket program to develop the chat room.So,anyone who has an idea about the"socket programming" and where to find a brief description about it will let me know please.
Cheers!!!!!!!
Thanks guys. 
|
|
|
|
|
|
HI all
I have URL which corresponds to the javascript file i want to store that file on my machine please tell me how to do it
URL is like
http://www.WebsiteName.com/ccpmweb/shared/document/svgRatesData.js
how to save that svgRatesData.js file on my machine
|
|
|
|
|
i have done with HttpRequest and httpWebResponse by getting response.
resStream = response.GetResponseStream();
_streamReader = new StreamReader(resStream);
string file=_streamReader.ReadToEnd();
StreamWriter sw=new StreamWriter(@"C:\NUnit\file.js");
sw.Write(file);
sw.Close();
But it is taking time to read from StreamReader as file is of 550 Kb Do anyone know any efficient way to download the file in less time
|
|
|
|
|
Use the file upload control and the command SaveAs
keep Learning and you never will be out of date...
|
|
|
|
|
CAn any one tell this problem's solution???
Here i have panel probelm,that i am using 3 panels belongs to 3 different forms and the data should be inserted into 3 different tables in the database.
Here my problem is,is it possible to insert the data at a time in three tables like in VB.
I have single add,edit and save buttons for these panels.CAn we move automatically to the next panel???
thanks in advance
kissy
|
|
|
|
|
Kissy16 wrote: is it possible to insert the data at a time in three tables like in VB
YES...Use ADO.NET for this.
Kissy16 wrote: CAn we move automatically to the next panel???
You can use a button like on button click, show 1st panel and hide the rest and if clicked again, show 2nd panel and hide rest. It purely depends on your logic what u want to achieve.
In future plz try to elaborate your problem more.
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
hi guys
i am creating folder thru asp.net with help of
system.io.directory.createdirectroy()
now i want to rename directory name....but this doesnt have inbuilt rename method. so if any one has done it before please help me.....
Regards,
DJ Rock
|
|
|
|
|
suppose ur file is located at c:\ with name 'rashida.txt'
u want to rename this file to 'rashida-1.txt'
then use
Directory.Move("C:\rashida.txt", "C:\rashida-1.txt");
this will rename ur file
thought it'll cut ur file and paste there with different name but u can rename the file in this way
|
|
|
|