 |
|
|
 |
|
 |
Hi, I am getting stuck... please advise how is the message value passed to the .cs file?
Public _Message As String
Public Property Message() As String
Get
Return _Message
End Get
Set(ByVal Value As String)
_Message = Value
End Set
End Property
but in the javascript code, it is calling _Message, shouldn't it be Message?
if (confirm(""" & _Message & """))
also, how shd I pass the "Message" value from my .aspx to the javascript?
Thanks in advance!
seashell
|
|
|
|
 |
|
 |
I have a problem.I want to create a dynamic button by Response.Write("<input name =\"button1\" type ="submit"..>.
now, i want to add event onclick to call a function for this button. What can i do?If anyone know please tell me.Thanks so much
|
|
|
|
 |
|
 |
Hello,
I am wondering if it is possible to use this functionality in an image button. I write a lot of apps using datagrids with column of image buttons used to edit update delete and add. I would like to use the Wait-Confirm button functionality when the user updates deletes and adds records to the datagrid. Can anyone help?
Thanks.
JP011
|
|
|
|
 |
|
 |
Michael
I did't get to simulate your code.
I create a asp.net project, and, in this project i tried to insert a class library or a web control library, but there were many errors that i didn't understand.
If it's possible i would like that you:
- send to me a complete Asp.Net project with your open code, or,
- try to explain how to do it.
Thanks
Wilsongb
|
|
|
|
 |
|
 |
Can it be done? My original page devel wasn't in Visual Studio, so I've created a dll out of this code, and I do the following:
<%@Import Namespace = "Confirm"%>
<%@Register TagPrefix="MG" Namespace="Confirm" Assembly="confirmButton" %>
But at the tag for the button I get the following parser error:
Could not load type Confirm.ConfirmWaitButton from assembly confirmButton, Version=1.0.1561.19828, Culture=neutral, PublicKeyToken=null.
|
|
|
|
 |
|
 |
Hi,
From a Save button, I display the confirm options OK and Cancel. If OK is clicked the record is saved correctly.
If the user clicks Cancel to correct some data and then clicks the Save button again I still get the confirm buttons displayed. It should just save the record without the confirm showing.
I think my problem is with the Save button attribute. Is there some way to reset this so it will not call the confirm buttons?
Many thanks
|
|
|
|
 |
|
 |
Hi ,
I want to use one button in my web application .which will act as confirm button some times not always depending on my condition .
so can you suggest how to use the control?
thanks
|
|
|
|
 |
|
 |
You ROCK!!!
I was looking for exactly what you had described and could not believe my luck. I am new at .net and found your solution to be just as I needed it to be. It worked with practically minimal change.
Thanks.
|
|
|
|
 |
|
 |
if you put a drive lock and you forgot the password for ibm hard drive only if you have a diffrent hard drive or laptop it will not work it might damage your computer you then need to open the hard drive and then press the reset botton it will only delete all the files after you delete the files you will need to open the inside of the hard drive and then put it in the bin after ypu done that you then need to get a new hard drive and t=then put it into you pc now your pc will be working good as new ok then you will need to pay 1000 pound for this serveis or you will be traced ok huh............... loser
|
|
|
|
 |
|
 |
I have create a list of email sites I have to go to on a daily basis. I would like to add checkboxes to my list so that I can keep track of the sites I go to.
The problem I have is that when I shut down list the boxes I have checked do not stay checked when I reopen the document. How can I keep the boxes checked when I shut down the window??
|
|
|
|
 |
|
 |
I'd like to disable the button after changing the text to "please wait"
unfortunately doing this stops the postback happening as this relies on the buton being enabled. Anyone found a way round this
|
|
|
|
 |
 | 578  |  | Anonymous | 21:09 22 Jun '03 |
|
|
 |
|
 |
You just call the pleasewait.aspx intead of the real page you want to load, but remember to pass a parameter called pagename=pageyouwanttoload.aspx
It works nicely!!
.apsx
<%@ Page language="c#" Codebehind="pleasewait.aspx.cs" AutoEventWireup="false" Inherits="AgentManagement.pleasewait" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>pleasewait</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
var intervalId;
function RedirectPage()
{
intervalId = window.setInterval("LoadPageName()",2000);
}
function LoadPageName()
{
window.clearInterval(intervalId);
window.location.replace("<%=url%>");
}
</script>
</HEAD>
<body önload="RedirectPage();">
<form id="pleasewait" method="post" runat="server">
|
<IMG alt="Logo de mapfre" src="ResourceFiles/images/mapfre_plain.gif" align="absMiddle">
|
|
PLEASE WAIT
|
</form>
</body>
</HTML>
Codebehind
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace AgentManagement
{
///
/// Summary description for pleasewait.
///
public class pleasewait : System.Web.UI.Page
{
//Local variables
public string url = "";
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
string keyName;
string keyValue;
string parameters = "";
if(Request.HttpMethod.ToString() == "GET")
{
for(int i = 0; i < Request.QueryString.Count; i++)
{
keyName = Request.QueryString.Keys[i];
keyValue = Request.QueryString[keyName];
if(keyName != "pagename")
{
parameters += keyName + "=" + keyValue + "&";
}
else
{
url = keyValue + "?";
}
}
}
else if(Request.HttpMethod.ToString() == "POST")
{
for(int i = 0; i < Request.Form.Count; i++)
{
keyName = Request.Form.Keys[i];
keyValue = Request.Form[keyName];
if(keyName != "pagename")
{
parameters += keyName + "=" + Server.UrlEncode(keyValue) + "&";
}
else
{
url = keyValue + "?";
}
}
}
parameters = parameters.Substring(0,parameters.Length - 1);
url += parameters;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
|
|
|
|
 |
|
 |
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
namespace TaxControlLib
{
///
/// Summary description for WebCustomControl2.
///
[DefaultProperty("Text"),
ToolboxData("<{0}:WebCustomControl2 runat="server">{0}:WebCustomControl2>")]
public class WebCustomControl2 : System.Web.UI.WebControls.Button
{
//private string _messge;
[Bindable(true),
Category("Appearance"),
DefaultValue("")]
public string _Message
{
get
{
return (_Message);
}
set
{
_Message = value;
}
}
///
/// Render this control to the output parameter specified.
///
/// The HTML writer to write out to
protected override void OnPreRender(EventArgs e)
{
String scriptString = "<script language=javascript> \n";
scriptString += " <!--\n";
scriptString += " function __doConfirm(btnWaiter) {\n";
scriptString += " if (confirm(\"Save changes to database?\")) {\n";
scriptString += " btnWaiter.setAttribute(\"value\",\"Please Wait...\");\n";
scriptString += " document.body.style.cursor=\"wait\"; \n";
scriptString += " return true; \n" ;
scriptString += " } return false; }\n";
scriptString += "-->\n" ;
scriptString += "</script> \n";
Page.RegisterClientScriptBlock("clientScript",
scriptString
);
this.Attributes["onclick"] = "return __doConfirm(this);";
base.OnPreRender(e);
}
}
}
-=zoltx=-
|
|
|
|
 |
|
 |
I tried your button, and it works fine. Have you seen any similar solutions that displays some type of message like "Please wait.......page is loading" . Then it disappears after the page loads. I've done this in classic asp, but I haven't seen any examples of this with asp.net.
Thanks,
Lee
|
|
|
|
 |
|
 |
http://www.dhtmlcentral.com/script/script.asp?id=17
|
|
|
|
 |
|
 |
yeah i wasn't thinking at all (sorry it was a 5 minute quick-coding session)....the javascript keeps the message in a variable within it.... if you're going to use more than 1, pass the message in as a variable to the function...the registered script should be the exact same thing for each button, unless you suffix it's name with the id of the button or something
sorry about this...next time i'll try to test stuff before i submit it
michael griffith
--------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
|
|
|
|
 |
|
 |
You need to replace the following special characters when you write out the _Message value to the client-side script:
- Chr(9) [Tab] - replace with
\t
- Chr(10) [LF] - replace with
\n
- Chr(13) [CR] - replace with
\r
- Chr(34) ["] - replace with
\"
- Chr(39) ['] - replace with
\'
- Chr(92) [\] - replace with
\\
|
|
|
|
 |
|
 |
This is not your fault but I was wondering if anyone knew how to combine this sort of thing with the use of the client side validation controls like RequiredFieldValidator?
Pete
|
|
|
|
 |
|
 |
you may want to check out my control library at http://www.metabuilders.com/
I have a suite of ConfirmedButton controls. source included.
I use the same trick that the Validation stuff uses to make it compatible.
|
|
|
|
 |
|
 |
very cool...i especially like the combobox. i actual created a simple control/app that mimicked the client side functionality of that one data drop down control, using microsoft's msxmlhttp object and some fun javascript (similar to yours). i'll have to dig that up and post it, and see if anyone could get some use out of it.
michael griffith
--------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
|
|
|
|
 |
|
 |
Thats a nice set of controls there Andy. Is this stuff free to use for comercial projects?
Pete
|
|
|
|
 |
|
 |
ya, use em however you want.
|
|
|
|
 |
|
 |
Think I broke it!
Tried your confirmed button after clicking the edit button in your sample grid, and it didn't ask for confirmation, the record was deleted, though.
by the way, good work you have here.
|
|
|
|
 |