473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

showcasing html page while clicking a button in same web page

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 2415
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 Expert 512MB
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 Expert 4TB
I don't see what the problem is - what have you tried?
Sep 17 '08 #4
Frinavale
9,735 Expert Mod 8TB
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 Expert Mod 8TB
Or it cold be as simple as adding a regular HTML hyper link to the page....the hyperlink will have the href="theUrlOfTheNewPage". Hyperlinks will only work if you don't require any processing before passing the user on to the other page.
Sep 17 '08 #6
Hi,

File upload control

Protected Sub FileUpload1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileUpload1.Load

If FileUpload1.HasFile Then
Label1.Text = "Received " & FileUpload1.FileName & " Content Type " & FileUpload1.PostedFile.ContentType & " Length " & FileUpload1.PostedFile.ContentLength
Else
Label1.Text = "Upload file"
End If

End Sub

Upload Button:

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

strName = System.IO.Path.GetFileName(FileUpload1.PostedFile. FileName)

Try
FileUpload1.PostedFile.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
Hi,

File upload contole

Protected Sub FileUpload1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileUpload1.Load

If FileUpload1.HasFile Then
Label1.Text = "Received " & FileUpload1.FileName & " Content Type " & FileUpload1.PostedFile.ContentType & " Length " & FileUpload1.PostedFile.ContentLength
Else
Label1.Text = "Upload file"
End If

End Sub

Upload Button:

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

strName = System.IO.Path.GetFileName(FileUpload1.PostedFile. FileName)

Try
FileUpload1.PostedFile.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
Hi,

File upload control

Protected Sub FileUpload1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileUpload1.Load

If FileUpload1.HasFile Then
Label1.Text = "Received " & FileUpload1.FileName & " Content Type " & FileUpload1.PostedFile.ContentType & " Length " & FileUpload1.PostedFile.ContentLength
Else
Label1.Text = "Upload file"
End If

End Sub

Upload Button:

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

strName = System.IO.Path.GetFileName(FileUpload1.PostedFile. FileName)

Try
FileUpload1.PostedFile.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 Expert 512MB
You know I read that whole post and it might have well been written in Greek... come again?
Sep 18 '08 #10
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.  

Hi,
Thank you for reply

Actually what am i trying, i am uploading an html file, after clicking upload button file should be upload, next when i click on input view button, it should open uploaded html file as a separate webpage.

please see the code what am i tried, hera i am able to upload. I want to open in separate webpage.

File upload
Expand|Select|Wrap|Line Numbers
  1. Protected Sub FileUpload1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles FileUpload1.Load
  2.  
  3.      If FileUpload1.HasFile Then
  4.           Label1.Text = "Received " & FileUpload1.FileName & " Content Type " & FileUpload1.PostedFile.ContentType & " Length " & FileUpload1.PostedFile.ContentLength 
  5.      Else
  6.           Label1.Text = "Upload file"
  7.      End If
  8.  
  9. End Sub
  10.  
Upload Button:
Expand|Select|Wrap|Line Numbers
  1. If FileUpload1.PostedFile Is Nothing Then
  2.      Me.Label1.Text = "No File Selected to Upload."
  3.      Exit Sub
  4. End If
  5.  
  6. strName = System.IO.Path.GetFileName(FileUpload1.PostedFile. FileName)
  7.  
  8. Try
  9.      FileUpload1.PostedFile.SaveAs("Path" + strName)
  10.      Me.Label1.Text = """" + strName + """ was uploaded successfully."
  11.      Catch ex As Exception
  12.           Me.Label1.Text = "An Error Occured While Uploading File."
  13.      End Try
  14. End Sub
  15.  
Input Button

What Am i to write to open uploaded html file as separate web page.
Sep 18 '08 #11
shweta123
692 Expert 512MB
Hi,

You can set postBackUrl property of your Input Button to redirect to the required Html page.
e.g.

<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl ="Yourpage.html" />
Sep 18 '08 #12
Frinavale
9,735 Expert Mod 8TB
I have merged your threads into one because it is very difficult to help you when you have 2 of the same question posted at one time.

Please do not double post your question in the future. There is a rule about Double Posting outlined in Posting Guidelines.

Please take the time to review all of the rules in the Posting Guidelines so that we can answer your questions more quickly and easily.

Also remember to use code tags when posting code snippets.

-Moderator Frinny
Sep 18 '08 #13
Hi Members,
Thanks I got Solution, For My post.
Thank you shweta123.
Sep 19 '08 #14

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

Similar topics

12
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...
4
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...
15
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...
4
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...
1
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...
1
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...
8
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...
2
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...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.