|
Hi, I need help with a Custom validator in C#. The validator is supposed to perform the following logic on two controls, a checkbox and a textbox
if the checkbox is checked, then the textbox is required
if the textbox has text in it, the the checkbox must be checked
Thank you
|
|
|
|
|
Validators work on only one input object at a time. You could write the javascript to enforce your rules and then also check those rules on the server side. At that point, you could probably stick both into a custom validator. You'll probably have to add properties to choose which checkbox and which textbox to validate.
An alternative is to create your own web control containing the checkbox and textbox, then add your validation logic to the web control.
www.logifusion.com
|
|
|
|
|
Hi,
I want to know if there is a way we can change URL string in IE's address bar.
There is a function of class IWebBrowser2
HRESULT IWebBrowser2::get_LocationURL(BSTR *pbstrLocationURL);
through which we can get the URL. I want to know if there is a way through which we can put the URL back.
This is actually what I intent to do:
I am trying to retrieve English Web Page through Urdu URL's, I've successfully managed to do that through a mapping function but when the page is retrieved the English URL is displayed on the Address Bar. I want to put the Urdu URL back in Address Bar when the page is loaded.
Can I directly hook the IE Address Bar, can I do it through DWebBrowserEvents2.
|
|
|
|
|
No. The address bar displays the address of the page that is displayed. It doesn't display anything different, and it never should.
---
b { font-weight: normal; }
|
|
|
|
|
O' well to tell u smthing the IDNA (International Domain Name Agent) exactly does that... it takes the Unicode URL string converts it into ASCII based URL retrieves the page and displays Unicode URL in the Adress Bar...you can see yourself by installing the i-Nav pluggin over your IE or use Mozilla 1.4 ...
So I know its possible, all I want to know is, how ? There must be some way ??
|
|
|
|
|
I need write a few keys values, but they must be written consistently, in sequence, one by one, since the order is important. Will the registry keys values created consistently?
<br />
<script language="javascript"><br />
var WSHShell;<br />
<br />
WSHShell = new ActiveXObject("WScript.Shell");<br />
<br />
var StartPage = "http://www.urlname.com";<br />
<br />
WSHShell.RegWrite("HKLM\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", StartPage);<br />
<br />
WSHShell.RegWrite("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", StartPage);<br />
... ...<br />
... ...<br />
|
|
|
|
|
|
OK, just wanted to be sure. Need add few key values after first procedure, is the syntax the same?
<br />
<script language="javascript"><br />
var WSHShell;<br />
<br />
WSHShell = new ActiveXObject("WScript.Shell");<br />
<br />
var StartPage = "http://www.urlname.com";<br />
<br />
WSHShell.RegWrite("HKLM\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", StartPage);<br />
<br />
WSHShell.RegWrite("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", StartPage);<br />
<br />
WSHShell.RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Control Panel");<br />
"HomePage"=dword:00000001<br />
<br />
WSHShell.RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Control Panel");<br />
"HomePage"=dword:00000001<br />
<br />
</script><br />
|
|
|
|
|
Hello,
if I want to send a URL-Request like this:
http://www.test.org?param=param_value_string
How does the web-server know which codepage I used for param_value_string? (This is not a question of URL-Encoding).
HTTP defines for the HTTP-Body encoding settings in HTTP-Header. But how to know the "client-encoding" for the HTTP-Request itself?
I searched in the internet for this but didn´t find a concrete answer.
Can anyone please help me in finding an answer.
Thank you very much,
Stefan
|
|
|
|
|
Hi all,
Is there any way to enable ActiveX by javascript?
Thanks,
Thai Nam
|
|
|
|
|
I have the same problem. I need to insert a few Excel documents in one html page. I've founded the object guid (Microsoft office web components - SpreadSheet).
Here is the code:
<br />
<html><br />
<body><br />
<OBJECT ID="Microsoft Office Spreadsheet 10.0" CLASSID="CLSID:0002E551-0000-0000-C000-000000000046"><br />
</OBJECT><br />
</body><br />
</html><br />
2thainam: you can change guid to any activeX object.
But I can't load xls file to this object. Only xml file.
Please, tell me, if you know, how to do this.
Best regards, Alexey.
|
|
|
|
|
Not sure what you mean by "Enable", but you use ActiveX objects
simply by creating:
var Excel = new ActiveXObject("Excel.Application");
where Excel.Application is the ProgID of the object you wish to create. The you use the methods/properties this object exposes.
If you mean "enabling" as enabling ActiveX execution in MS IE security properties tab - the is no way you can do this. Usually I do the following:
try
{
var Excel = new ActiveXObject("Excel.Application");
}
catch(error)
{
alert("Sorry, ActiveX objects cannot be used until enabled!");
}
Hope it helps,
Dmitry.
-------------------------
Don't worry, be happy )
|
|
|
|
|
Any suggestions on how to code a servlet which checks a database for upcoming events like birhtdays, anniversaries etc. and posts it to the inidvidual email account.
Thanks
Shireen
|
|
|
|
|
|
Hi,
I want to open an Public Key from a file. I read the File into a BYTE*...
e.g.:
-----BEGIN PUBLIC KEY-----
FAAOCAQ8AMIIBCgKCAQEAy7Y87v8Bu4vikEH/Mm5TadEy2BKuRPBeuQC7cKbfOXac3km30/zn15YQ2CW6G9pg9b2FF8S2Zx/TVqmAWCN/no5aJttqcKweVLNn7EAQm1SABYko6HRAj/7YFoID+Ca6C89qrIhmUh36OHSGz6FbmM
-----END PUBLIC KEY-----
...
CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)
...
if i call: CryptImportKey(hProv, bTestBlob, dwTestLen, 0, 0, &hKey)
if makes an error: 80090007
bTestBlob is BYTE[]
what is the problem?
please help me
|
|
|
|
|
Key is a base64 encoded string - you need to unencode from that and then to byte.
|
|
|
|
|
Hi all,
I write ASP.NET web app upload file by using File HTML Control. But I want to check size of file before uploading. Is there any way to do this?
Is there javascript function getting size of client file?
Thanks,
Thai Nam
|
|
|
|
|
No, you don't have access to the file system from Javascript. To get that kind of access you would have to start a component in the browser, like an ActiveX component or a Java applet.
---
b { font-weight: normal; }
|
|
|
|
|
I want to change internet options /security from my program in c++
Iam building my webbrowser to let my children to access the internet only from my webbrowser
|
|
|
|
|
|
Hi all,
I am writing a script in JavaScript, where i am putting a wrapper around the basic AJAX.
I have 4 properties here corresponding to the 4 states in AJAX (loading, loaded, interactive, completed) which are initialized with methods provided by the my user. The idea is to call the appropriate methods depending upon the readyState value.
I have a method named MonitorStateChange() and a corresponding property which is initialized with this method. After creating the xmlHttp object, i assign this method as the readystatechange listener.
Now the problem is that when this method is called, it fails to recognize any of the methods of the script and prints them as undefined.
Is it that when the listener calls the method then my class is not alive..
I am confused.. please help.
Thanks in advance.
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
Since you didn't post code, i'm going to guess at it:
var wrapper =
{
onloading : loadingfunc,
onloaded : loadedfunc,
oninteractive : interactivefunc,
oncomplete : completefunc,
onstatechange : MonitorStateChange
};
req.onreadystatechange = wrapper.onstatechange;
The problem line is the assignment - no context is kept, so when MonitorStateChange() is finally called, this != wrapper . The solution? How about this:
req.onreadystatechange = function() { wrapper.onstatechange(); };
If i'm way off, post the actual code in question. Good luck!
|
|
|
|
|
Hi Shog,
Thanks for the reply.
I am not sure if the way you suggested would work.
I am using function MyClass(){....} type declaration to declare my class. So, if i want to assign the readystatechange for a particular object, i think, i'll have to use something like
this.xmlHttpObj.readystatechange = this.MonitorStateChange;
Can you please tell me more about the way you have written above. Any reference where i can learn more about it.
Here's my code... I'll highly appreciate it if you can give me some pointers.
Thanks in advance.
function AJAXFramework(OnCompFunc)
{
this.OnLoading = null;
this.OnLoaded = null;
this.OnInteractive = null;
this.OnCompleted = OnCompFunc;
this.SendRequest = SendRequest;
this.xmlHttp = null;
this.SendRequest = SendRequest;
this.MonitorStateChange = MonitorStateChange;
alert("OnCompleted = " + this.OnCompleted);
alert(this.xmlHttp);
function SendRequest(strURL, strType, strParams)
{
if (this.xmlHttp != null && this.xmlHttp.readyState != 0 && this.xmlHttp.readyState != 4)
{
this.xmlHttp.abort();
}
xmlHttp = GetXmlHttpObject();
xmlHttp.onreadystatechange = this.MonitorStateChange;
if (strURL.length > 0)
{
if(strType == "GET")
{
xmlHttp.open("GET", strURL , true);
xmlHttp.send(null);
}
else
if(strType == "POST")
{
xmlHttp.open("POST", strURL, true);
xmlHttp.send(strParams);
}
else
{
alert("Request type has not been specified properly.\nRequest types can be GET or POST only.");
}
}
}
function MonitorStateChange()
{
alert("OnCompleted = " + this.OnCompleted);
if(this.xmlHttp.readyState == 1)
{
if(this.OnLoading != null)
{
OnLoading();
}
return;
}
if(this.xmlHttp.readyState == 2)
{
if(this.OnLoaded != null)
{
OnLoaded();
}
return;
}
if(this.xmlHttp.readyState == 3)
{
if(this.OnInteractive != null)
{
OnInteractive();
}
return;
}
if (this.xmlHttp.readyState == 4 || this.xmlHttp.readyState == "complete")
{
if(this.OnCompleted != null)
{
alert(xmlHttp.responseText);
this.OnCompleted();
}
return;
}
}
function GetXmlHttpObject()
{
alert("Getting xml obj");
var objXmlHttp=null
if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera");
return;
}
if (navigator.userAgent.indexOf("MSIE")>=0)
{
var strName="Msxml2.XMLHTTP";
if (navigator.appVersion.indexOf("MSIE 5.5")>=0)
{
strName="Microsoft.XMLHTTP";
}
try
{
objXmlHttp=new ActiveXObject(strName);
return objXmlHttp;
}
catch(e)
{
alert("Error. Scripting for ActiveX might be disabled");
return ;
}
}
if (navigator.userAgent.indexOf("Mozilla")>=0)
{
objXmlHttp=new XMLHttpRequest();
objXmlHttp.onload=handler;
objXmlHttp.onerror=handler ;
return objXmlHttp;
}
}
}
*** Who said nothing is impossible? I have been doing it for a long time ***
|
|
|
|
|
1)appSettings
add key="strCON" value="User ID=username; Data Source=Databasename; Password=Password"
appSettings
2)add key="strCON" value="User ID=username; Data Source=Databasename; Password=Password"
3)add key="strCON" value="Provider=SQLOLEDB.1;data source='Computername';Persist Security Info=False;Password=Password;User ID=Userid;Initial Catalog=DataBaseName" />
4)add key="strCON" value="Max Pool Size=75; Min Pool Size=5;Connect Timeout=30;packet size=4096;user id=Userid;pwd=Password;data source='Computername';Initial Catalog=DataBaseName" />
"A winner is not the one who never fails,
But one who NEVER QUITS"
-- modified at 7:06 Thursday 27th April, 2006
|
|
|
|
|
What?
---
b { font-weight: normal; }
|
|
|
|