|
|
I don`t know whether ASP script can do that. But thanks anyway.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
|
You can raise the error in the Stored Procedure
Like Colin Stated
<br />
CREATE PROCEDURE InsertGroupIdAndName <br />
@GroupId int, <br />
@groupName varchar(128)<br />
AS <br />
IF NOT EXISTS(SELECT GroupId,GroupName FORM GroupTable WHERE GroupId = @GroupId AND GroupName=@groupName)<br />
BEGIN <br />
INSERT GroupTable(GroupId, GroupName) <br />
VALUES (@GroupId, GroupName) <br />
END<br />
ELSE<br />
BEGIN <br />
RAISERROR (Group Name:%d with groupID %d Already exists',<br />
16, 1, @groupName , @GroupId)<br />
END<br />
GO
16,1 = severity , state
lookup proper syntax for RAISEERROR
Then Catch the error in the code. You do catch you errors right?
If using vbscript in the asp page....
<br />
On error resume next<br />
<br />
Database insert stuff...<br />
<br />
If err.number <> 0 then<br />
do something with err.number & err.description<br />
End IF
|
|
|
|
|
I read Nick Pirocanac's CoolButton composite control article and downloaded the code and have it running on my machine.
I created a simple composite control from scratch but the delegate is never called and the event never fires. I would appreciate another pair of eyes to point out what I am missing. Here is my code:
namespace TestCustUC
{
[ToolboxData("<{0}:WebCustomControl1 runat=server>")]
public class WebCustomControl1 : System.Web.UI.WebControls.WebControl
{
private Button butOK;
public event EventHandler Click;
protected override void CreateChildControls()
{
butOK = new Button();
butOK.Text = "OK";
butOK.Width = Unit.Pixel(50);
Controls.Add(butOK);
// Add handler for the OK button click postback event.
butOK.Click += new EventHandler(this.OnButOK_Click);
}
protected virtual void OnButOK_Click(object sender, EventArgs e)
{
if (Click != null)
{
Click(this, e);
}
}
}
}
Thanks for taking a look!
tim t
|
|
|
|
|
I had to study the examples in the SDK QuickStart (plus others I found online) quite a bit before I got my own custom control working just the way I wanted. I changed your code slightly in headers and declaration, and the event is now triggered; hope this at least helps get you started. Check out esp. info on implementing the INamingContainer interface and EnsureChildControls.
Regards,
-lp
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace TestCustUC
{
//[ToolboxData("<{0}:WebCustomControl1 runat=server>")]
public class WebCustomControl1 : Control, INamingContainer
{
private Button butOK;
public event EventHandler Click;
protected override void CreateChildControls()
{
butOK = new Button();
butOK.Text = "OK";
butOK.Width = Unit.Pixel(50);
Controls.Add(butOK);
// Add handler for the OK button click postback event.
butOK.Click += new EventHandler(this.OnButOK_Click);
}
protected /*virtual*/ void OnButOK_Click(object sender, EventArgs e)
{
if (Click != null)
{
Click(this, e);
}
}
}
}
|
|
|
|
|
epatton -- Thanks for taking the time to dig into my code and suggest changes and resources for more information!
I played with the code as well and got it to work following a different avenue. It appears that if you attribute the control class for design time support ([DefaultProperty("Text"),ToolboxData...), then you should follow through and implement, for example, the 'Text' property, using the call to 'EnsureChildControls'.
Sounds OK, huh? But the project still didn't run correctly!
This will sound like a bunch of hocus pocus, but the next thing i did was to re-arrange the Page and Register directives on the .aspx page that used the control, F5 and then everything ran perfectly!
I believe this forced VS to rebuild its in memory representation of the project, rewiring the project correctly and allowing it to run.
Anyway, that's my theory....
Thanks again for your help.
tim t
|
|
|
|
|
Hi frinds,
I am working on a project where i want to access the function of child web page
i know if u want to access the function of parent webpage
u can access it through window.opener or document.parent
But i want to access the function of child form
is there any code to access the child form or i can make the object of child form and then access the function.
thanks
(Hemant U. Mane)
|
|
|
|
|
when you open a new window using window.open(), you end up naming the window in the second argument.
window.open("bob.html", "bobWin", "width=500, height=500") for example creates a new window called bobWin. if you use that instead of "window", you should be able to point to anything there.
|
|
|
|
|
I tried to access the frames in an HTML page hosted by CWebBrowser2 control. Each time, I can query valid IOleContainer interface. However. When use EnumObjects function of this interface, an exception was thrown. Does anybody know what kind exception was thrown, what cause this problem?
I followed the instructions published in Microsoft web (How to get the WebBrowser object model of an HTML frame http://support.microsoft.com/default.aspx?id=196340) here are the codes:
I followed the instructions published in Microsoft web(How to get the WebBrowser object model of an HTML frame http://support.microsoft.com/default.aspx?id=196340) here are the codes:
// Get the IDispatch of the document
LPDISPATCH lpDisp = NULL;
lpDisp = m_webBrowser.GetDocument();
if (lpDisp)
{
IOleContainer* pContainer;
// Get the container
HRESULT hr = lpDisp->QueryInterface(IID_IOleContainer,
(void**)&pContainer);
lpDisp->Release();
if (FAILED(hr))
return hr;
IEnumUnknown* pEnumerator;
// Get an enumerator for the frames
hr = pContainer->EnumObjects(OLECONTF_EMBEDDINGS, &pEnumerator);
pContainer->Release();
|
|
|
|
|
Hi all, i am involved in writing an application at the moment that will require IIS to be installed to run. Is there a way that i can check to see if IIS has already been installed when i install my application? And if it has not already been installed i need to install it, although i think i can manage that bit
Cheers
Kev
|
|
|
|
|
Hi,
does anyone know how macromedia does the silent install of the flash player? do i need wise to automatically install some components? or can i use msi...if so how do i do it?
thanks
|
|
|
|
|
i know that other tools have a "/silent" option, where you can execute them with the silent commandline flag. i would presume that msi would have the same or similar...
--
Raoul Snyman
Saturn Laboratories
e-mail: raoul.snyman@saturnlaboratories.co.za
web: http://www.saturnlaboratories.co.za/
blog: http://blog.saturnlaboratories.co.za/
linux user: #333298
|
|
|
|
|
Even though it is not defined on this page :p, the .msi install option you want is "/q". I'm sure there is a similar list of .msi install option flags somewhere on Microsoft's site...
John Hebert
Solvitur Ambulando
|
|
|
|
|
Hi everyone,
i have an ASP.NET service site, that is used to send a link to the mobile of the customer to download a file from our server throught GPRS, now the problem i face is that i want this customer to download this file only one time...then if he try to download the file again, he cant...
so is there any to know if this customer downloaded this file , or is there any way the web server can know that a gprs connection contacted that file and it has been downloaded...
Kind Regards
Mahmoud Manasrah
|
|
|
|
|
I would like to know
using ASP code
How to write / copy a text file from a server into client machine's root(c:\).
I tried using fso but the file is created/copied in the server machine itself.
Please give me a sugggestion
Thanks in advance
Biju
|
|
|
|
|
nbiju wrote:
How to write / copy a text file from a server into client machine's root(c:\).
the short answer is: you can't.
the long answer is: you can get the user to download the file.
--
Raoul Snyman
Saturn Laboratories
e-mail: raoul.snyman@saturnlaboratories.co.za
web: http://www.saturnlaboratories.co.za/
blog: http://blog.saturnlaboratories.co.za/
linux user: #333298
|
|
|
|
|
Thanks for the reply.
Actually I am searching for a solution other than download or saveAs method.
That means the work should be done without user's knowledge.
Thanks
Biju
|
|
|
|
|
like i said before: you can't. the webserver doesn't even know who or what the client machine is. the only way you can transfer files to the client machine is via active download. the client *has* to request the file, the server cannot just send it.
--
Raoul Snyman
Saturn Laboratories
e-mail: raoul.snyman@saturnlaboratories.co.za
web: http://www.saturnlaboratories.co.za/
blog: http://blog.saturnlaboratories.co.za/
linux user: #333298
|
|
|
|
|
nbiju wrote:
That means the work should be done without user's knowledge.
Imagine surfing to a website, and without your knowledge they could place a file on your hard-drive (*). I think you can see why this is not permitted.
(*) There have been security flaws in IE that allow exactly this, but they are usually shut by the next security patch.
|
|
|
|
|
First:
When I use a router with internal IPs and I use a high anonimity HTTP proxy directly in the browser, the JavaScript see my real IP, it doesn`t see the Local IP, when I use a socksifier with a socks proxy in it like SocksCap and I socksifity the Browser through SocksCap, the JavaScript see as Local IP the internal IP adress of the computer (router ip adress) also Java can`t give to the server the truly real ip ! Why is this difference ? also with HTTP proxy directly in IExplorer, Java see the truly real ip alltrough I use a router, and Why with a socksifier the result is the best also...Java is not capable to see the truly real ip ?
Twice:
I have a problemm also when I use a anonimity HTTP proxy in the Internet explorer but I have Java enabled, the Java script test see my real IP directly from the network card settings, I can`t change the card ip because...the net doesn`t work then, I know that with a router can I use a internal IP and so Java see only this IP as Local IP but I wish that I don`t use the router also I want a program which can spoof the JavaScript results also....for example The Java must give to the test server a fake real ip as truly network card ip (Local IP). I wish put in the program the spoofed ip for example...1.1.1.1 and the JavaScript give to the server "Real IP: 1.1.1.1 (Local IP)" Can someone help me ?
so
|
|
|
|
|
hiii
i would like to know what is MFC?
|
|
|
|
|
The Microsoft Foundation Classes (MFC) are a set of classes which wrap the native Windows API and supposedly make it simpler to program. Support for MFC ended with Visual C++ 6, though there is a huge amount of existing software out there using it.
Since this is a web forum, and your previous post mentioned a web project, I assume that you're trying to create a web application. In that case, I'd highly recommend that you not waste your time on MFC, but move directly into C# or C++ development using Visual Studio .Net 2003. VS.Net 2003 and the CLR make it wonderfully easy to create web-based applications. If for some reason you're constrained to using MFC, check out the excellent collection of articles here at Code Project to help you get started. You might also spend some time at msdn.microsoft.com [^], but Microsoft has been deleting content related to MFC faster than I can click a link.
"If it's Snowbird season, why can't we shoot them?" - Overheard in a bar in Bullhead City
|
|
|
|
|
i would like to make a library project
in my company,and i would like to make
it a web application,
and in the same time, i would like to use
oracle database
what is the optimal way for this
thank for all
|
|
|
|
|
Well, it is difficult to answer such a question without knowing more specifics. However, I will try. If you are running Microsoft Windows, I recommend that you get a copy of Visual Studio.NET and then read through a tutorial on creating web applications that connect to a database to create dynamic web pages.
If you could provide more information, such as your development machine's operating system and your webserver's operating system, we could give you better answers.
Good luck!
John Hebert
Solvitur Ambulando
|
|
|
|