There is a problem if you use window.open()
, because most pop-up blockers block window.open()
, whether it is legit or not.
lucjon
Posts
-
Hiding menubar, statusbar and toolbar in javascript -
Need code for display the text with ImageHere is the old code in C#:
protected void button1_Click(Object sender, EventArgs e) {
Response.Redirect("ThisPage.aspx?showtext=text&imageloc=loc");
}
protected void label1_PreRender(object sender, EventArgs e) {
if (Request.QueryString("showtext")!=null||Request.QueryString("showtext")!="") {
label1.Text = request.QueryString("showtext");
}
}
protected void pictureBox1_PreRender(object sender, EventArgs e) {
if (Request.QueryString("imageloc")!=null||Request.QueryString("showtext")!="") {
pictureBox1.ImageLocation = Request.QueryString("imageloc");
}
} -
Need code for display the text with ImageSorry :-O You could try this:
public string GetImagePath()
{
switch (ddlsunsign.Text) {
case Aries:
return "../../DesignTier/SignImages/ariesstat.jpg";
case Aquarius:
return "../../DesignTier/SignImages/aquariusstat.jpg";
//case Libra, Pisces,...
case default:
return null;
}
}
public string GetStat()
{
switch (ddlsunsign.text) {
case Aries:
return //database code
//etc
case default:
return null;
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (GetImagePath()!=null&&GetStat()!=null) {
Response.Redirect("ThisPage.aspx?imageloc=\"" + GetImagePath + "\"&text=\"" + GetStat() + "\"");
}
}
protected void descriptionLabel_PreRender(object sender, EventArgs e)
{
if (Request.QueryString("text")!=null) {
descriptionLabel.Text = Request.QueryString;
}
else {
descriptionLabel.Text = "Error";
}
}
protected void signImage_PreRender(object sender, EventArgs e)
{
if (Request.QueryString("imageloc")!=null) {
signImage.ImageLocation = Request.QueryString("imageloc");
else {
signImage.ImageLocation = //friendly error message;
}
} -
operating system accounts(to login) in vb.netI think it is showing the real accounts, with the `hidden` accounts, such as the help and support account, if you have VMWare installed, __vmware_user__ and other things. You could try:
For Each oresult In ocollection
Dim oname As String = oresult("Name").ToString
If Not oname.StartsWith("SUPPORT") Then
If oname <> "__vmware_user__" Then
If oname <> "ASPNET" Then
If oname <> "HelpAssistant" Then
textBox1.Text = oname & " "
End If
End If
End If
End IfI don't know if this'll work very well.
-
Detect system shutdownI searched the web and you can use the
Microsoft.Win32.SessionEnded
event, as described here. Also, the Shutdown event in ApplicationEvents.vb or similar (I don't know about C#/++ or J#) refers to the Shutdown of your application, not the system. -
EmulatorThere are various PS2 emulators, but using the ROM's required is illegal due to copyright law. This also applies to all recent games consoles. If you are unsure, ask the manufacturer.
-
How to download an executeable file, if only zip files can be downloadedI have written a program that should work. Download files using this instead of your web browser. It is in a ZIP here (http://gargunnockp56.somee.com/)
-
Need code for display the text with ImageHi, I'm going to assume that you are passing the text to the age through the page parameter "showtext" (page.aspx?showtext="what to show"). This first example has a button that shows the text:
Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Response.Redirect("ThisPage.aspx?showtext=text")
End SubSub Label1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Label1.PreRender
If Request.QueryString("showtext") <> Nothing Or Request.QueryString("showtext") <> "" Then
Label1.Text = request.QueryString("showtext")
End If
End SubTo show the Image, I assume that you are passing the image location through the parameter "imageloc". It also has the button:
Sub Button1_Click(ByVal sender As Object, byVal e As System.EventArgs) Handles Button1.Click
Response.Redirect("ThisPage.aspx?imageloc=image1.png")
End SubSub PictureBox1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles PictureBox1.PreRender
If Request.QueryString("imageloc") <> Nothing Or Request.QueryString("imageloc") Then
PictureBox1.ImageLocation = Request.QueryString("imageloc")
End If
End Sub -
Input Textbox ColourSelect the input fields and set the BackColor property to White. This will mean no matter what, your field background should be white.
-
Downloading a cab file without any chenge in content or size..Hi, I don't know if you've tried this, but you could try:
public void SendFile(String myFilePath) {
Response.TransmitFile(myFilePath)
}For more information on
Response.TransmitFile
then go to: http://msdn.microsoft.com/msdnmag/issues/06/09/webdownloads/default.aspx -
Critical VS2005 ErrorHi, 2 errors have suddenly appeared in VS2005 (VB): 1. Whenever I switch to code view, it crashes and comes up with an error reporting dialog. This happens whether I press F12 (custom key), I click Main.vb or double-click a control. 2. When I open Choose Toolbox Items, then COM Components, then Browse... to access the Mozilla ActiveX control which didn't register properly, it hangs. Any help would be very much appreciated. By the way, none of this happens in C# Studio.
-
VS 2003 in vista Find locking up IDEI think moving to VS2005 may be your only option. Unless you have an XP disc and a spare partition/hard disk. If you move to VS2005, download SP1 for Vista: Download details page Also, you should contact the company that provides your 3rd party stuff, see if there are free or reduced cost options for upgrading. Another option, though it's a bit fiddly, is to install both versions, and use VS2005 when the 3rd party software isn't needed.
-
exe in the system trayYou could tell the installer to execute your program after the installation has finished.
-
ASP.NET Ajax v1.0 -
how to get value in the textboxHi, AFAIK, there is no OnFocus event in the ASP.NET textbox. If txt2 is the editable one, and you want to have txt3 updated when txt2 is changed, you could do:
Protected Sub txt2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt2.TextChanged
If Txt1 <> "" And Txt2 <> "" Then
Txt3.Text = txt1.Text & txt2.Text
Else
'Error handling code
End If
End Sub -
How to insert text at cursor position in a TextBoxHi, I am looking for a way to insert text into a TextBox at the current position, as I am trying to make an site to create web pages with Google stuff (like Maps, Search). I know that you can do
TextBox1.Text.Insert(1, New IO.StreamReader("Maps.txt").ReadToEnd)
, but I need to replace 1 with the current cursor position in the TextBox. It is being written in VB, but I can do a little bit of C#. Thanks
-
Sudden form creation error after no code changeThanks, I'll just try that now.
-
Sudden form creation error after no code changeSorry I did not mention this, but my RibbonBar has disappeared. Kind of. When I click on its area, it shows up in the properties window, but it is just blankon the form. Sorry.
-
Sudden form creation error after no code changeI'm quite new to programming and VB.NET, so Idon't know if this is really obvious. I ran my Rich Text Editor (using Telerik R.A.D. RibbonBar and your own [ExtendedRichTextBox](http://<a href=)), and I got the following error: An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object. Stack trace:
at WindowsApplication1.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190 at WindowsApplication1.My.MyProject.MyForms.get_frmMain() at WindowsApplication1.My.MyApplication.OnCreateMainForm() in C:\Documents and Settings\lucas\My Documents\Visual Studio 2005\Projects\LucasToolsEditor\My Project\Application.Designer.vb:line 35 at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
Thanks.