473,666 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

showcasing html page while clicking a button in same web page

7 New Member
Hi,
How to redirect the Html page in spcicific location, while clicking hyperlink or link button.

Please help me i am fresher for Asp.net.
its urgent


Thank you....
Sep 17 '08 #1
13 2441
maddiashok
7 New Member
Hi,
I want to showcase html page while clicking a button in same web page
is it possible or not
if possible how send me the sample code

Please help me regarding this task

thank you
Sep 17 '08 #2
shweta123
692 Recognized Expert Contributor
Hi,

To redirect the Html page to different location you have to write code on OnClick event of Link button.
e.g.

In aspx page create LinkButton tag like the following way :

Expand|Select|Wrap|Line Numbers
  1. <asp:LinkButton ID="LinkButton1" runat="server" OnClick = "LinkButton1_Click" >LinkButton</asp:LinkButton>
In code behind page write the following code :
Expand|Select|Wrap|Line Numbers
  1.  
  2. Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
  3.         Response.Redirect("Default.aspx")
  4. End Sub
  5.  
Sep 17 '08 #3
kenobewan
4,871 Recognized Expert Specialist
I don't see what the problem is - what have you tried?
Sep 17 '08 #4
Frinavale
9,735 Recognized Expert Moderator Expert
I don't understand what you mean by "showcasing "
Could you please provide more details on what you are trying to achieve along with what you've tried so far.
Sep 17 '08 #5
Frinavale
9,735 Recognized Expert Moderator Expert
Or it cold be as simple as adding a regular HTML hyper link to the page....the hyperlink will have the href="theUrlOfT heNewPage". Hyperlinks will only work if you don't require any processing before passing the user on to the other page.
Sep 17 '08 #6
maddiashok
7 New Member
Hi,

File upload control

Protected Sub FileUpload1_Loa d(ByVal sender As Object, ByVal e As System.EventArg s) Handles FileUpload1.Loa d

If FileUpload1.Has File Then
Label1.Text = "Received " & FileUpload1.Fil eName & " Content Type " & FileUpload1.Pos tedFile.Content Type & " Length " & FileUpload1.Pos tedFile.Content Length
Else
Label1.Text = "Upload file"
End If

End Sub

Upload Button:

If FileUpload1.Pos tedFile Is Nothing Then
Me.Label1.Text = "No File Selected to Upload."
Exit Sub
End If

strName = System.IO.Path. GetFileName(Fil eUpload1.Posted File.FileName)

Try
FileUpload1.Pos tedFile.SaveAs( "Path" + strName)
Me.Label1.Text = """" + strName + """ was uploaded successfully."
Catch ex As Exception
Me.Label1.Text = "An Error Occured While Uploading File."
End Try

Here i am able to upload the html file, But i want to show or open the uploaded file by clicking InputView Button, in the same web page Bottom or a pop up window. and i am unable catch the file name which one am i uploading. i want to catch the file name and have2 store in a string and have2 use in other buttons in same web page.
Sep 18 '08 #7
maddiashok
7 New Member
Hi,

File upload contole

Protected Sub FileUpload1_Loa d(ByVal sender As Object, ByVal e As System.EventArg s) Handles FileUpload1.Loa d

If FileUpload1.Has File Then
Label1.Text = "Received " & FileUpload1.Fil eName & " Content Type " & FileUpload1.Pos tedFile.Content Type & " Length " & FileUpload1.Pos tedFile.Content Length
Else
Label1.Text = "Upload file"
End If

End Sub

Upload Button:

If FileUpload1.Pos tedFile Is Nothing Then
Me.Label1.Text = "No File Selected to Upload."
Exit Sub
End If

strName = System.IO.Path. GetFileName(Fil eUpload1.Posted File.FileName)

Try
FileUpload1.Pos tedFile.SaveAs( "Path" + strName)
Me.Label1.Text = """" + strName + """ was uploaded successfully."
Catch ex As Exception
Me.Label1.Text = "An Error Occured While Uploading File."
End Try

Here i am able to upload the html file, But i want to show or open the uploaded file by clicking InputView Button, in the same web page Bottom or a pop up window. and i am unable catch the file name which one am i uploading. i want to catch the file name and have2 store in a string and have2 use in other buttons in same web page.


I don't see what the problem is - what have you tried?
Sep 18 '08 #8
maddiashok
7 New Member
Hi,

File upload control

Protected Sub FileUpload1_Loa d(ByVal sender As Object, ByVal e As System.EventArg s) Handles FileUpload1.Loa d

If FileUpload1.Has File Then
Label1.Text = "Received " & FileUpload1.Fil eName & " Content Type " & FileUpload1.Pos tedFile.Content Type & " Length " & FileUpload1.Pos tedFile.Content Length
Else
Label1.Text = "Upload file"
End If

End Sub

Upload Button:

If FileUpload1.Pos tedFile Is Nothing Then
Me.Label1.Text = "No File Selected to Upload."
Exit Sub
End If

strName = System.IO.Path. GetFileName(Fil eUpload1.Posted File.FileName)

Try
FileUpload1.Pos tedFile.SaveAs( "Path" + strName)
Me.Label1.Text = """" + strName + """ was uploaded successfully."
Catch ex As Exception
Me.Label1.Text = "An Error Occured While Uploading File."
End Try

Here i am able to upload the html file, But i want to show or open the uploaded file by clicking InputView Button, in the same web page Bottom or a pop up window. and i am unable catch the file name which one am i uploading. i want to catch the file name and have2 store in a string and have2 use in other buttons in same web page.







I don't understand what you mean by "shwocasing "
Could you please provide more details on what you are trying to achieve along with what you've tried so far.
Sep 18 '08 #9
balabaster
797 Recognized Expert Contributor
You know I read that whole post and it might have well been written in Greek... come again?
Sep 18 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

12
6533
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
4
3407
by: frogman042 | last post by:
My daughter is playing around trying to learn JavaScript and she wrote a small program that prints out a message in increasing and decreasing font size and color changes. She is using document write and it works fine until she puts it into a function and then calls the function from a button with onClick. This also seems to work OK, with the exception that the page is cleared, and the curser changes (and stays) as an hourglass. In...
15
4753
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
4
1993
by: Sathyaish | last post by:
I am no JavaScript progammer, and unfortunately am having to babysit an old code base that has a lot of JavaScript in it. I have two questions: (1) Can two HTML controls have the same name? It looks like the obvious answer is NO. (2) What if? What if the developer has given two HTML controls the same name, i.e has created the same button more than once with exactly the
1
1173
by: Daniel | last post by:
Hi, We are working on a web app, where there is a export options for csv, pdf and html. Here when the export button is clicked for exporting as html "File Download" dialog window pops uo with open, save and cancel. If we hit the open button, the html page opens in the same window. But we want tht to open in a seperate window. This happens only whn the user clicks the open button rather that the save button for exporting. Is there a option...
1
1340
by: itarunachalam | last post by:
Hi, We are working on a web app, where there is a export options for csv, pdf and html. Here when the export button is clicked for exporting as html "File Download" dialog window pops uo with open, save and cancel. If we hit the open button, the html page opens in the same window. But we want tht to open in a seperate window. This happens only whn the user clicks the open button rather that the save button for exporting. Is there a option...
8
3343
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to the folder in which the all the 4 files (3 HTML + 1 ASP) reside & select Index.html (by clicking with the mouse or by using the arrow keys on the keyboard), strangely the Windows "File Download" dialog box (with 'Open', 'Save', 'Cancel', 'More...
2
1881
by: ppuniversal | last post by:
Hi All, My question is as follows: I have a text box and two links.Let the two links be - Show and Save . On clicking the Show , a web page is generated by fetching some data from database according to the input in the textbox and the web page is displayed to the user. Now on clicking Save also, with the same input to the textbox, the same set of data will be fetched from the database, but in this case I do not want the web page...
3
2407
by: ton | last post by:
Hi, I'm using AJAXPRO this works very well. What I want to do is to add new page elements at my web site without using a postback. And I do not mean listitems but a complete dialog. Let me give an example: in my application which will contain of several pages I'll use a filter/query mechanism, so if the user wants to add a new filter or modify
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7386
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.