|
Hmm...
So you're not already scaling the image and worried users might need to see more detail? You're just trying to get the image to "fit"?
If you are able to depend on a bit of JS, you can let the browser scale by picking whichever dimension fits... worst (width if clientWidth-imgWidth < clientHeight-imgHeight, else height) and specifying just that dimension as an attribute on the img tag (most browsers seem to understand that scaling proportionally is a good thing).
Alternately, if you can spare the server horsepower, you can use a bit of script to re-write the img src as the window loads, specifying the available space as query params and letting the server scale to exact dimensions. This looks great, since you can use high-quality scaling algorithm and fill whatever size of window you need. For obvious reasons, it does tend to be slower (although you can cache the most common dimensions). And, of course, you need to have a handler for image requests where otherwise you might get away with letting IIS serve them up raw. YMMV.
---- ...the wind blows over it and it is gone, and its place remembers it no more...
|
|
|
|
|
Yeah, the idea of having a httphandler that servers the images had occured to me. We have a bit of js flying around, I may go with that option - thanks.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Response.Write " "
Whats wrong in this code,if asp with JAvasript is using
|
|
|
|
|
s4_sabahatf wrote: Response.Write " "
Err, it's completely pointless?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Your question is very vague. Do you get an error message from your code?
If you're using server-side JavaScript then you probably need something like:
Response.Write(" ") ;
You have to be careful with JavaScript because it is case-sensitive.
Regards
Andy
|
|
|
|
|
Nothing. You can't possibly have anything wrong with it because the question has no context. You might want to start with explaining what you're doing, why you've written this little piece of code, what's happening when it runs, what you expect it to do, ...
|
|
|
|
|
how to embed source in table using asp & VB script
|
|
|
|
|
s4_sabahatf wrote: how to embed source in table using asp & VB script
Could you be any more vague?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
The "source" of what? What do you mean by "source"? A source of sarcasm?? You've definately coem to the right place - especially if you ask really vague questions like this.
|
|
|
|
|
<%
Response.Write "<table><tbody><tr><td>The Source!</td></tr></tbody></table>"
%>
---- ...the wind blows over it and it is gone, and its place remembers it no more...
|
|
|
|
|
Hi all,
I'm working on VB.Net 2003 with ASP.Net,in my application i want to place a button and on click of it, it has to show some controls and again on click of the same button the controls which r previously visible show hide (for the same button click). I'm not able to proceed further in this regard so pls help me how to proceed with this situation, if any examples are there it would be more helpful
pls help me
|
|
|
|
|
sivaram praveen wrote: I'm not able to proceed further in this regard
Why not? What efforts have you made to solve the problem yourself?
sivaram praveen wrote: pls help me how to proceed with this situation
By writing some code.
All ASP.NET controls inherit from System.Web.UI.Control[^]. The Control class has a Visible property. Handle the button click event and toggle the state of this property for each control to show or hide it.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks for ur reply
I have apply the "Visible" property, but on click of the button it is going to show all the controls n again on click of the same button event those controls should not be visible? For example when we post a query in our "CodeProject" Site, by clicking on the question or replies the text will be visible and again on click of the question only the title is visible; hiding the text.
In this similar fashion i want to apply for my application?
So pls help me
|
|
|
|
|
so wrap the controls within a div tag and apply the visibility toggle to that...
Fred
|
|
|
|
|
To produce similar funcionality to the CodeProject forums, you will have to write Javascript code to show and hide elements. A quick Google search yielded the following results[^] on this subject.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
how can i create a web page which is capable to send data to other id
|
|
|
|
|
Assuming you are using ASP.NET, look at the classes in the System.Net.Mail[^] namespace to learn how to send emails.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hey guys
I've tried most events that I have found on the net but none seem to fire when I want, it is almost as if there is no event being fired. I have a scrollable panel in my asp.net page and want to maintain the scroll position.
First I tried to do it through .Net using the MaintainScrollPoisition property but that didn't work. I then turned to javascript to try and get the job done, I have two methods, one that saves the position and one the sets the position of the scrollbar. The save method works fine on the onscroll event but I can't seem to find an event that fires after the panel (which renders as a div in html) has completly finished loading.
I have tried using the window.onload to run it but the div doesn't actually have a scrollbar when this fires. I then tried running it when the readyState is set to completed but that also runs before the panel has finished. Any help on what other events I can try will be much appreciated. Many thanks in advance.
PS the panel is within a page in a masterpage in .Net but I don't think that should affect anything when doing it via javascript.
-- modified at 4:17 Tuesday 27th November, 2007
|
|
|
|
|
|
Hi Michael, thanks for the reply.
The code you provided is similar to what I currently have but as yet doesn't work, the only difference being that I am using hidden fields to store the position of the scroll rather than a cookie.
When I put an alert in with the function after setting the scrolltop, the page and all the information is there and visible when the alert pops up but the DIV doesn't have any scrollbars yet (it just carries on through the bottom of the page). Once ok is pressed the DIV appears to resize (no resize event fires...) and then the scrollbars appear. Setting the scrolltop property when no scrollbar is present does not change the value, it stays at 0.
That is what I want to do when the DIV has finished loading and the scrollbar is present, set the position of the scrollbar.
Can the resizing be due to the DIV having it's width and height being set as a percentage rather than an absolute?
-- modified at 4:27 Friday 30th November, 2007
|
|
|
|
|
hi its work but i want to if any error massage then retrive all input text but its forget it after click on submit button or any error message so where is the mistake
[code]
<%@ Language=VBScript%>
<%Option Explicit
If Request.Cookies("userid") = "" Then
Response.Redirect "login.asp"
Else
Dim R, page,vopenflg
Dim vlaunchby,i,vcount
Dim vtopid,vnoofreply
Dim vtopstatus
Dim vtopsub
Dim vemail
Dim vmsg
Dim errorMsg
Dim conn
Set conn = Server.Createobject("ADODB.Connection")
conn.Open "DSN=ORACLE; User ID = STARTER; Password = STARTER"
Set R = Server.CreateObject("ADODB.Recordset")
R.Open "Select top_id from topmaster order by top_id ", conn, adOpenStatic, adLockOptimistic, adCmdText
If R.Recordcount > 0 Then
R.Movelast
vtopid = R("top_id")
vtopid = CInt(vtopid) + 1
Else
vtopid = 1
End if
R.Close
vopenflg=Response.Write("N")
vnoofreply=Cint(vnoofreply)
vnoofreply=0
If Not IsEmpty(Request.Form("submit")) then
vtopstatus = Request.Form("vtopstatus")
vtopsub = Request.Form("vtopsub")
vopenflg=request.form("vopenflg")
vmsg = Request.Form("vmsg")
vtopsub = trim(vtopsub)
vopenflg=trim(vopenflg)
vnoofreply=trim(vnoofreply)
vmsg = trim(vmsg)
vtopstatus = trim(vtopstatus)
If len(errorMsg) = 0 Then
If len(vtopsub) = 0 Then
errorMsg = "Please Enter Topic Subject "
End If
End if
If len(errorMsg) = 0 Then
If len(vmsg) = 0 Then
errorMsg = "* Your must enter your message"
end if
if len(vmsg) > 500 Then
errorMsg = "** More than 500 characters...now limiting to 500 "
End If
End If
If len(errorMsg) = 0 Then
conn.Close
conn.Mode = adModeReadWrite
conn.Open
R.Open "Select * from topmaster", conn, adOpenStatic, adLockOptimistic, adCmdText
R.Addnew
R("top_id") = vtopid
R("top_sub") = vtopsub
R("topic_status") = vtopstatus
R("launch_by") = request.cookies("userid")
R("launch_dt") = Cdate(date())
R("open_flg")= request.form(vopenflg)
R("no_of_reply")=vnoofreply
R("msg") = vmsg
R.UPdate
R.Close
Response.Redirect "message.asp"
End If
END IF
End If
%>
<title>Voice Of Baraunians
POST YOUR MESSAGE
<%If len(errorMsg) > 0 Then
Response.Write " " & errorMsg & " "
End If
%>
Topic Subject : | | | ( Please Post Message Within 500 Character ) | | Message : | |
function goback()
{
window.location = "brvoice.asp"
}
[/code]
sanjeev
|
|
|
|
|
Your post is so badly formatted that it's impossible to understand what your code does.
Also, why are you still using ASP? It's obsolete. ASP.NET has been around now for about 6 years so you should really consider moving to it.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi how can table data align to justified i am using but not work was don
sanjeev
|
|
|
|
|
Try like that ~
style="text-align:justify"
Example :
<div style="text-align:justify">
The Code Project discussion boards - Web DevelopmentThe Code Project discussion boards - Web DevelopmentThe Code Project discussion boards - Web DevelopmentThe Code Project discussion boards - Web DevelopmentThe Code Project discussion boards - Web DevelopmentThe Code Project discussion boards - Web Development
</div>
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
can i align data from table by this way
[code]
<%do while not R1.eof%>
<% if R1("open_flg")="A" Then%>
<%elseif R1("Open_flg")="C" Then%>
<%else%>
<%End if
R1.movenext
loop%>
<%=R1("rep_by")%> | <%=R1("reply") %> | <%=R1("rep_dt")%> | <%=("Reply is Rported To Abuse") %> | <%=R1("rep_dt")%> | <%=R1("reply")%>
>Report Abuse | <%=R1("rep_dt")%> |
[/code]
-- modified at 1:43 Tuesday 27th November, 2007
sanjeev
|
|
|
|