|
|
actually I have an html page on which progress bar is there... I want to display that html page while loading the second page(i.e Form2)... Kindly check site cleartrip.com... and click on search flights... In that after clicking on search flights on page is displayed... like loading... and after that flight details page is displayed ... I want to display like that...
|
|
|
|
|
Ah, so I don't think you actually want to display an intermediate page while the desination page is loading (e.g., loading JavaScript files, CSS files, and so on). My guess is you are doing some sort of database query that makes the desination page take a long time to load. In that case, when you nagivate to the intermediate page, do the database queries there. Once the database queries have completed, stored them in a temporary table or a session variable to cache them, then redirect the user to the destination page (which will then load the data from the cache).
Also, that would basically be the same as showing a splash screen on your destination page while the page loads. That's the route I recommend you take. You basically show an image (or progress bar or whatever) and when your page has finished loading, you hide the splash screen (which reveals your actual page).
|
|
|
|
|
actually requirement is to display html page only.... not the image...
Please help me .... how can I do that in ASP.NET....?
|
|
|
|
|
I just told you, but you seem to just be focusing on that last part of my message. Read my message again.
Also, anything you can display in an HTML page you can also display as a splash screen. It can have images, DIV's, text, tables, whatever.
|
|
|
|
|
I have a sql server database table that contains documents that need to be downloaded from an internal site. The files are uploaded as varbinary(max) and I have the mime type for the file saved in the database (which will only be word and pdf, plus some wordperfect, files). Can someone let me know how I can pull those down from the database when a user needs to view the file? I'm already saving images in the database and I am able to pull those down using a http handler. Would that be the same process for this?
|
|
|
|
|
Aptiva Dave wrote: Would that be the same process for this?
Without knowing what your current process is that would be difficult to say.
Since an image is sent over the wire and rendered on the page it doesn't need additional processing. However, the file is on demand, when a user clicks a link it needs to be retrieved from the database and sent so a HTTPHandler would be necessary to process the request.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
and that is what I was kind of thinking. The way I am using the handler for images is that I point an image control's navigate URL to the handler ("www.mysite.com/ShowImage.ashx?ID=23"), which I can also use as a link for an image and pull up just fine as well. I couldn't find any good tutorials on the net that explained how docs were downloaded, just how they were uploaded. thanks.
|
|
|
|
|
So I tried implementing the same logic used to get images from the database, but instead of displaying the file my browser wants to open a file called DisplayResume.ashx.
Here is the code I used in my event Handler:
<%@ WebHandler Language="VB" Class="displayResume" %>
Imports System
Imports System.Web
Imports System.IO
Imports System.Data
Imports System.Data.SqlClient
Imports util
Public Class displayResume : Implements IHttpHandler
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
Dim appID As Integer
Dim mimeType As String
If Not context.Request.QueryString("ID") Is Nothing Then
'place ID in the the appID variable
appID = context.Request.QueryString("ID").ToString
'get the mimetype for the file from table
mimeType = getMimeType(appID.ToString)
If Not mimeType Is Nothing Then
context.Response.ContentType = mimeType
Dim strm As Stream = getResume(appID)
Dim buffer As Byte() = New Byte(4095) {}
Dim byteSeq As Integer = strm.Read(buffer, 0, 4096)
Do While byteSeq > 0
context.Response.OutputStream.Write(buffer, 0, byteSeq)
byteSeq = strm.Read(buffer, 0, 4096)
Loop
Else
Throw New ArgumentException("Can't retrieve MIME Type")
End If
Else
Throw New ArgumentException("No Parameter specified")
End If
End Sub
''' <summary>
''' Gets the mime type for the resume from the database
''' </summary>
''' <param name="appID">appID for the resume we are looking for</param>
''' <returns>mimetype string</returns>
''' <remarks></remarks>
Public Function getMimeType(ByVal appID As String) As String
Dim rdrMime As SqlDataReader = GetReader("select mimeType from resumes where appID =" & appID)
Dim mimetype As String = Nothing
Try
While rdrMime.Read
mimetype = rdrMime("mimeType").ToString
End While
Catch ex As Exception
Return Nothing
Finally
rdrMime.Close()
End Try
Return mimetype
End Function
''' <summary>
''' gets the binary format of the file from the database
''' </summary>
''' <param name="ID">appID that is pointing to the resume file</param>
''' <returns>binary representation of the resume file</returns>
''' <remarks></remarks>
Public Function getResume(ByVal ID As Integer) As Stream
Dim strConnection As String = ConfigurationManager.ConnectionStrings("connectionString").ToString
Dim conn As SqlConnection = New SqlConnection(strConnection)
Dim sql As String = "Select theFile from Resumes where appID = " & ID
Dim cmd As SqlCommand = New SqlCommand(sql, conn)
Try
conn.Open()
Dim file As Object = cmd.ExecuteScalar
Return New MemoryStream(CType(file, Byte()))
Catch ex As Exception
Return Nothing
Finally
conn.Close()
conn.Dispose()
End Try
End Function
Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
Get
Return False
End Get
End Property
End Class
|
|
|
|
|
Did you add the required settings in the web.config file?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
What setting would that be? I never have made any changes for displaying images before.
|
|
|
|
|
I'm sorry, you were writing and http handler, I thought you knew you need to add it the web.config file also.
http://support.microsoft.com/kb/308001[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Okay. I've never had to do that with my images, so i guess I never knew to add anything to the web config. I'm still confused as to what I need to set the path and type to in the add section under httpHandlers.
|
|
|
|
|
How to Protect XML from outside access in asp.net.
I have use
<configuration>
<location path="Login.xml">
<system.web>
<authorization>
<deny users="*"/>
</authorization>
</system.web>
</location>
</configuration>
But it doesn`t work online.
|
|
|
|
|
I'm pretty sure that's a setting you should be setting on the folder containing the XML file on the web server. Alternatively, you can embed the XML file in your application's DLL, which will make it inaccessible to the client side. Or you could store it in a database.
|
|
|
|
|
I have xml in root folder. I just want to stop viewing xml file from outside.
|
|
|
|
|
Hi All,
I developed a login page and added a link button(for logout) in all other pages. The code that I used behind logout is just Response.Redirect("Login.aspx")
So, when I click logout, it redirects me to the Login page but when I click back button in the browser, it goes into the application without the need of login.
Can anyone please help me how to do a safe logout in a web appliction so that even when I click back button it should not be entered into the application again without a proper login?
i've neither used a session variable nor FormsAuthentication. If I have to use session variables, please explain me how to use them(as I'm new to .NET). The code that I used in the login page is below:
Imports System.Data.SqlClient<br />
<br />
Partial Class Login<br />
Inherits System.Web.UI.Page<br />
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate<br />
Dim authentication As Boolean = False<br />
authentication = Sitelevelauthentication(Login1.UserName, Login1.Password)<br />
e.Authenticated = authentication<br />
If authentication = True Then<br />
Response.Redirect("Default.aspx")<br />
End If<br />
<br />
End Sub<br />
Private Function Sitelevelauthentication(ByVal Username As String, ByVal Password As String) As Boolean<br />
Dim boolretval As Boolean<br />
Dim con As New SqlConnection<br />
Dim Dr As SqlDataReader<br />
Dim sql As String<br />
con.ConnectionString = "Data Source=;Initial Catalog=;User ID=;Password="<br />
sql = "SELECT * FROM Login"<br />
con.Open()<br />
Dim cmd As New SqlCommand(sql, con)<br />
Dr = cmd.ExecuteReader()<br />
While Dr.Read()<br />
If Username = Dr("Username").ToString And Password = Dr("Password") Then<br />
boolretval = True<br />
End If<br />
Dr.Close()<br />
Return boolretval<br />
<br />
End While<br />
End Function<br />
End Class
Thank you,
Ranjani.
|
|
|
|
|
|
|
Hi All,
I have .cmd file which has an environment variable steps. This .cmd file is giving wrong results. When I edit and saw the .cmd file its setting the steps evn variable twice. Is it because of this the wrong results are coming.
Whats the meaning of setting the env variables twice, does it give different meaning than setting it for only once. And whats the impact of setting the environment variables twice.
set steps=%steps% "_07.5.2 QUTransUnionSimulator"
set steps=%steps% "_07.5.1 RunScoreBureauSimulator"
set steps=%steps% "_07.5.2 QUTransUnionSimulator"
set steps=%steps% "_07.5.1 RunScoreBureauSimulator"
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
I doubt you'll get an answer in the Asp.Net forum for a .cmd question. Try posting in the right place: perhaps the System Admin forum.
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Ok. Sure. Thanks.
Thanks & Regards,
Abdul Aleem Mohammad
St Louis MO - USA
|
|
|
|
|
My page currently displays the five most recent feeds off a site. However I would like to try and filter the feeds based on keywords that are in the description field. My code right now for downloading the feed and binding it to a repeater is:
Dim rssHUDPressDoc As XDocument = XDocument.Load("http://www.hud.gov/news/hudrss.xml")
Dim pressPosts = From item In rssHUDPressDoc.Descendants("item") _
Take 5 _
Select Title = item.Element("title").Value, _
link = item.Element("link").Value, _
description = item.Element("description").Value, _
pubDate = item.Element("pubDate").Value
If pressPosts.Count = 0 Then
lblNoPress.Visible = True
Else
rssHUDPress.DataSource = pressPosts
rssHUDPress.DataBind()
End If
The above code returns the feeds just fine and I'm able to display it with no problem. However I'm trying to do something to the effect that if I have a string array of keywords:
Dim keywords() as string = new string(){"keyword1","keyword2","keyword3"}
I can change the LINQ statement to something like this:
Dim pressPosts = From item In rssHUDPressDoc.Descendants("item") _
Take 5 _
Where item.Element("description").Value.ToString.Contains(keywords)
Select Title = item.Element("title").Value, _
link = item.Element("link").Value, _
description = item.Element("description").Value, _
pubDate = item.Element("pubDate").Value
However the .Contains() method only accepts a single string, not an array. Currently I need to filter by multiple keywords that apply to our industry and I'm trying to avoid writing numerous OrElse statements within the Where clause. Any suggestions on how I can do this?
Thanks in advance for any help. Been working on this problem for two days now and I can't think of what else to try.
|
|
|
|
|
I have a normal ASP web app that navigates to a different content page when a menu clicked. As usual, this type of navigation is a normal function of menu control. My question is how do I call back to an EXE or VBScript file from a menu-item? Thanks.
Best,
Jun
modified on Friday, May 27, 2011 9:55 AM
|
|
|
|
|
See Here[^], it should help.
------------------------------------
I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave
CCC Link[ ^]
Trolls[ ^]
|
|
|
|