|
<html>
<head>
<style type="text/css">
#yourDivID {
visibility: hidden;
display: none;
}
</style>
</head>
<body>
<div id="yourDivID">
<select>
<option value="1"> One </option>
<option value="2"> Two </option>
</select>
</div>
<input type="button" onclick="document.getElementById('yourDivID').style.visibility = 'visible'; document.getElementById('yourDivID').style.display = 'block';" value="Click me!" />
</body>
</html>
Does that help?
|
|
|
|
|
Sort of. Remember that the first button is not an input type, it's just an href to a javascript because it HAS to have 2 parameters passed to it. That javascript needs to get this third value from the drop down in order to send all 3 parameters to a PageMethod.
Here it looks like You made a "Click Me" that pops open the div, I assume waits for the selection, then closes it?
|
|
|
|
|
Hello!
I have been asked to develop user authentication for a lan site based on a certain dll that will be provided - I have no ideia where to start. Would someone be kind enough to provide any tips or tutorials or examples regarding dll based authentication in classic ASP?
I reckon its a pretty vague question, but I've been looking into ISAPI based authentication and I still have no clue.
Thanks in advance,
|
|
|
|
|
Hi,
I'm getting desperate. I've tried an amazing combination of header commands to get IE8 to prompt a file dialog box for a known or unknown MIME type.
I've spent a lot of time researching this and I still can't get anything that IE8 likes without hanging. My code works fine in Google Chrome, Mozilla and Firefox...
Does anyone know how to get this to work in IE8?
I've tried this:
protected void Page_Load(object sender, EventArgs e)
{
Download(Session["Arquivo"].ToString());
}
private static void Download(string mCaminho)
{
byte[] docByteArray = StreamFile(mCaminho);
FileInfo doc = new FileInfo(mCaminho);
using (MemoryStream ms = new MemoryStream(docByteArray))
{
long dataLengthToRead = ms.Length;
int blockSize = dataLengthToRead >= 5000 ? 5000 : (int)dataLengthToRead;
byte[] buffer = new byte[dataLengthToRead];
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("Pragma","public");
HttpContext.Current.Response.AddHeader("Cache-Control","no-store, no-cache, must-revalidate");
HttpContext.Current.Response.AddHeader("Cache-Control","post-check=0, pre-check=0");
HttpContext.Current.Response.AddHeader("Content-Description","File Transfer");
HttpContext.Current.Response.AddHeader("X-Download-Options","noopen");
HttpContext.Current.Response.AddHeader("X-Content-Type-Options","nosniff");
HttpContext.Current.Response.AddHeader("Content-Transfer-Encoding","binary");
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + doc.Name);
HttpContext.Current.Response.AddHeader("Content-Length", doc.Length.ToString());
HttpContext.Current.Response.ContentType = TipoArquivo(doc.Name);
while (dataLengthToRead > 0 && HttpContext.Current.Response.IsClientConnected)
{
Int32 lengthRead = ms.Read(buffer, 0, blockSize);
HttpContext.Current.Response.OutputStream.Write(buffer, 0, lengthRead);
dataLengthToRead = dataLengthToRead - lengthRead;
}
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Close();
}
HttpContext.Current.Response.End();
}
private static String TipoArquivo(String mArquivo)
{
String mContentType = String.Empty;
switch (Path.GetExtension(mArquivo))
{
case ".pdf":
mContentType = "application/pdf";
break;
case ".xls":
mContentType = "application/vnd.ms-excel";
break;
case ".doc":
mContentType = "application/doc";
break;
case ".xlsx":
mContentType = "application/vnd.ms-excel";
break;
case ".docx":
mContentType = "application/msword";
break;
case ".rtf":
mContentType = "application/rtf";
break;
case ".txt":
mContentType = "text/plain";
break;
case ".zip":
mContentType = "application/zip";
break;
case ".xml":
mContentType = "application/xml";
break;
}
return mContentType;
}
private static byte[] StreamFile(string filename)
{
FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
byte[] ImageData = new byte[fs.Length];
fs.Read(ImageData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
return ImageData;
}
|
|
|
|
|
I don't have IE8. However assuming IE8 works correctly when you use it to download a file, like a zip code file from a CodeProject article, then you can write your own client (or just use a telnet session) and send the server the IE8 Agent header information and look at the HTTP response it sends back that works in IE8. I mean can't you?
|
|
|
|
|
The culprit is the no-cache header. To fix it remove the following line:
HttpContext.Current.Response.AddHeader("Cache-Control","no-store, no-cache, must-revalidate");
Please refer to the following Microsoft KB article for more info:
http://support.microsoft.com/kb/316431[^]
Good luck,
Sonny
|
|
|
|
|
Hello,
I've come across an article on placing PHP environmental variables into Apache logs.
I'd prefer to code with apache_setenv() and apache_getenv(), but I'm curious if anyone has experience with this method over using apache_note()? Are there any security concerns with one over the other?
Any input is appreciated.
Thanks,
Matt
|
|
|
|
|
EDIT: Found the solution to the problem. I used method 1. I nested the navigation bar in a DIV and the content holder in another DIV already, so all I did was set the bottom padding of the navigation's DIV long enough to nest the hover menu as it drops. I then adjusted the contentholder's top margin to a negative value so that the menu could overlap on hover. Hm I might write a tutorial over the summer about how to make a hover menu without a defined width so that the listed items' boxes all align to the width of the item with the maximum width automatically (the menu having no dependancy on it's parent's width). Btw, only tested with FF, IE7/8 and the lastest version of safari. Will test on Opera as well before posting; maybe IE 6 if people still care about it :P.
Another way was to just change the position of the nav bar's div to absolute but that makes things too messy. Much rather be lazy with the margin's solution and not spend ages fiddling about to make it look exactly the same on most browsers.
-------------------------------------------------
Hi guys,
I've been experimenting a way of creating horizontal drop down menus without defining a specific width. I found a solution in the end which works for IE8 and Firefox, but no surprise, IE 7 plays up. Trying to solve for IE7 has left me in two situations:
1) The first method uses:
ul#nav li:hover ul
{
display:block;
position:absolute;
padding-top:0px;
padding-left:0px;
padding-right:0px;
padding-bottom:0px;
margin-left:0px;
}
this is combined with a float:none in the sorted list held in the unested list (above) i.e ul#nav li:hover ul li . This method works fine in IE 8 and Firefox. I like this method because the hover menu is not limited to the relative width of its parent list. The problem with this method is, on IE 7, for some reason, as I try to hover over the lower list items, the hover menu dissapears and i suspect this has to do with the hover menu overlapping the text and being at a z-index value furthur behind. I tried to bring the z-index value of the hover menu forward but didn't have much luck with that.
second method:
the second method simply uses the old fasioned position:relative to nest the hover menu. I have kept the width undefined, and so long named anchors in the hover menu are not scrunched up! The problem with this method basically is the reverse of the first method. The hovering works fine but now the parent list keeps resizing its length to the maximum width of the child list (if it's wider than the parent list). Furthurmore, the nice floating effect has gone (but i reckon this could easily be fixed).
I have come here to ask if anyone knows a solution to either method. if all else fails i guess i could resort to specific element ids again...
Thanks,
Arroci
modified on Wednesday, June 24, 2009 9:27 AM
|
|
|
|
|
Hi everybody
I'm trying to save image from webBrowser control which I have in my project. I could do it by right clicking on the
image and selecting "Save Picture As..." context menu, except I wanted to do it programmatically.
I found a solution like this:
this->webBrowser1->Document->execcommand("Save As", false, strFilePath); but it doesn't work (it always show save as dialog box - I do not want a save as dialog box to show up).
Some one has better idea?
|
|
|
|
|
I have a .aspx page that has 2 javascript calls on it. They worked previously and now are broken. Through Firefox's web development addon, I am getting errors like:
ToggleDetail is not defined
TesterDetail.aspx?name=xxx
I have checked everything I can think of 100 times over:
1) My .aspx page has a ScriptManager with
path="testerdetail.js"
in it.
2)My testerdetail has the correct spellings of the functions being called.
3)The number of parameters in the call and declaration match
What am I missing, why is this happening?
Here is one of the functions with issues in JavaScript:
function OpenChecklistForm(id,uut){
window.open('ChecklistForm.aspx?UUT='+uut',&tid='+id'_blank''scrollbars=yes,resizable=yes');
}
With an error from Firefox web dev kit saying "Missing ) after argument list", but points to the single quote after uut in the window.open call.
modified on Tuesday, June 23, 2009 4:14 PM
|
|
|
|
|
Here's your problem. ,&tid='+id'_blank''
Make sure you are creating a valid string and passing in the correct arguments to window.open
|
|
|
|
|
hi all,
i'm trying to use javascript funtcion 'javascript:window.print();' to print current webpage.
the problem that i lose all my color font, layout when i do the print.
is there something to add to CSS to print the same page as it is shown on screen ?
Thank you for helping me
|
|
|
|
|
Make sure the CSS you're using isn't scoped to just the 'screen.' If it is, you'll have no stylesheets while printing
|
|
|
|
|
<style type="text/css" media="print">
</style>
<style type="text/css" media="screen">
</style>
|
|
|
|
|
am using windows XP as a development enviroment my web site is published usig IIS
i have 3 pages
Default , Login , Adduser
my authentication is "Forms"
my DB is saved in an XML File existing in the project folder which is c:\inetbub\wwwroot\MyApp
in the login form i check the user name if it is admin and it has the right password i use
"Server.transfer("Adduser.aspx")" to go to the addu user page
the page is displayed well but the main active code in this page targets to edit the xml file
while this code is initiated a windows login form appears again and i gave it all the avaialble users found on my machine but i could not pass it so i cant add or edit any new user.
by the way while my application was file based this problem was not existing
also the anonymous authintication is allowed and windows authentication too
Please some one help me with this error
thnaks
|
|
|
|
|
I have a asp page who return a set of data from sql server 2008 and it work fine on a lot of machines.
But in some one machines the records are returned only partially (with the same query??)
Sam body have an idea on this problem?
|
|
|
|
|
Probably more suitable for the asp.net board.
When you view the source of the rendered html page does is it complete, i.e. does it end with ?
|
|
|
|
|
Do I need to download any smtp server or do I simply just specify it in my C# code?
ML Lingwati
|
|
|
|
|
You need to specify it in you C# code, but you usually either have to download or install one to be able to use it. If you already have one, and have permissions to it, all you need to do it specify it.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
You point your message to your email server. For example:
using System.Net.Mail;
class Emailer
{
private void SendEmail()
{
MailMessage theMessage = new MailMessage();
MailAddress whoTo = new MailAddress("John.Doe@abc.com", "John Doe");
MailAddress whoFrom = new MailAddress("Sue.Smith@123.com", "Sue Smith");
theMessage.To.Add(whoTo);
theMessage.From = whoFrom;
theMessage.Subject = "Real Important Message";
theMessage.Priority = MailPriority.Normal;
theMessage.Body = "This is a real important email message.";
theMessage.IsBodyHtml = true;
SmtpClient client = new SmtpClient();
client.Host = "mail.123.com";
client.Send(theMessage);
}
}
Regards,
Gary
|
|
|
|
|
I want to open a child pop-up window from the parent window but i want cursor remain in the parent window e.g if there is a textbox for name and cursor is placed in this and after sometime a pop-up opens then the cursor should remain in the text area.
Any suggestion............
Do good and have good.
|
|
|
|
|
If you're using a classic popup window which opens a new instance of the browser you won't be able to do much about it because the window loses focus. If you're using a DHTML popup you shouldn't have to do anything.
|
|
|
|
|
Hello,
How can i export "Installed Updates"(vista) list to text file.
I tried with win32_quickfixengineering class and windows update history.
but the problem is, "description" property of above two class is not matching with "Installed Updates" result.
I need to export the list to text file exactly the "Installed Updates" shows.
I am attaching the code also(which i tried)
-----------------------------------------------------------------
using quick fix engineering
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_QuickFixEngineering",,48)
Set objFSO = CreateObject("Scripting.FileSystemObject")
if objFSO.FileExists(outputPath & "PrgList.txt") then
objFSO.DeleteFile outputPath & "PrgList.txt",True
end if
Set filePrgList = objFSO.CreateTextFile(outputPath & "PrgList.txt", True)
For Each objItem in colItems
filePrgList.WriteLine("Caption: " & objItem.Description)
Next
filePrgList.close
Set filePrgList = nothing
Set objFSO = nothing
-----------------------------------------------------------------------
Using Update History
Set objSession = CreateObject("Microsoft.Update.Session")
Set objSearcher = objSession.CreateUpdateSearcher
intHistoryCount = objSearcher.GetTotalHistoryCount
Set colHistory = objSearcher.QueryHistory(1, intHistoryCount)
For Each objEntry in colHistory
Wscript.Echo "Description: " & objEntry.Description
Next
|
|
|
|
|
not VBscript but
try wmic (a built-in MS app )
start --> run --> cmd (with CTRL+SHIFT+ENTER = admin right!)
wmic:root\cli>QFE get
output to file using
wmic:root\cli>/output:C:\InstallList.txt QFE get
Also have u tried looking in the registry for list of installed app, or alternatively the uninstall listing
|
|
|
|
|
Hi all,
I have a dynamic menu in asp.net that its BackGround is an colory image that convert dark blue to light blue, but if my menu be longer, this image be repeat more and more...
Now how I can convert one color to another color with java script to height of menu? for example dark blue to light blue.
Thank You
Hoda
|
|
|
|