|
Hi,
I have a web page which has some table rows having background color. When I'm printing the page its not printing. I'm using IE 5.5 as the web browser. When I checked the Internet Options, the checkbox for Print background images and colors are not checked and when I checked this option and printed the page, the background color is printing. I need help for how to set the value of Print background images and colors checkbox to checked when I'm printing. I'm using only Javascript as the scription language and no database is used. If any of you have some ideas please send immediate response.
|
|
|
|
|
In what conditions the dialog ask for user name, password and domain will be triggered, after open IE for browing?
|
|
|
|
|
Hi there,
When the anonymous access is disabled for the web application, and the authentication mode is set to Windows, here I assume i'm talking about an ASP.NET application. For more information, you can see IIS Authentication[^]
|
|
|
|
|
Thanks for your reply!;)
Here I am just remake the environment. Our customer's environment.
In our development environment we have the direct access to internet, So there's no problem getting data from internet. But when it comes to our customer's environment it just didn't works, because the the way they gain access to internet. They have domain , they have proxy server, kind of complex environment.
They need to type the user name, password and which domain they're in in order to gain access to internet, but I just don't know how to remake it in our own environment!
|
|
|
|
|
How does your application access the resources on the internet? Does it use the WebRequest to create HttpWebRequest ?
|
|
|
|
|
through the
CInternetSession
CHttPFile
|
|
|
|
|
I'm not familiar with the MFC stuff, but in this case you need to specify the proxy server before accessing the resources on the internet. You may look at the parameters in the object constructor, or you can post this question in the C++ forum.
|
|
|
|
|
Actually the implement is not urgent, What I need the most is to mimic the environment!That is when everything set up, once I open IE for browing, I'll get a dialog box asking for user name, password and which domain you're in!
|
|
|
|
|
|
|
There is a setting in the Http stuff you are using to tell it to use the existing IE settings when connecting. That would do the trick.
|
|
|
|
|
Hey minhpc_bk,
If the user is already logged on to the network and authenticated, is there some way to set it up so that Windows authentication doesn't pop up the login dialog?
Matt Gerrans
|
|
|
|
|
Hi Matt,
It all depends on the browser the user uses to browse the application and the windows authetication mode applied to the application. For example, the ASP.NET application is using the Integrated Windows Authentication (best suited for an intranet environment), if the client uses the IE browser, then the login dialog does not pop up as the IE will first use the current Windows logon information to send to the server. If the authetication fails, the browser then prompt the user for a user name and password. For non-Microsoft browsers like FireFox ..., you may need to check their documentation, but AFAIK the FireFox by default prompts the user with the login dialog box.
|
|
|
|
|
Hi:
Later I find out that our customer's web environment is exactly the same as you said. They used ISA Server, your reply did help me thanks.
And now I trying to configure the our environment using ISA, in which I install the ISA Server on Win 2k Advanced Server(two network adapters installed, one is connected to the internet, one is connected to the Lan). The internal networks' IP range is (..167.0 - ..167.255) in ISA, the Lan network adapter's IP is ..167.10. . I pointed the client's proxy server to ISA's Lan IP. When everything is done, I really get promoted for a username and password under the basic authentication method!
But I wonder How to configure the client's username and password!
|
|
|
|
|
One of the scenarios here is to set up an ISA server in a domain, and what you need to do is to configure the system policy for the ISA server 2004. There are a couple of rules which can apply to the Authentication services, for example the Active Directory rule is selected. When a client in the domain wants to access the resources on the internet through the web proxy server(ISA server), he first needs to provide his account in the domain(username and password). The ISA validates this info against the domain controller to see if this is a valid account in the domain or not, then the client can proceed or has to provide a valid account. So the ISA server needs to be set up in a domain so that it can access the list of all accounts in the domain, then you can configure the rule in the way you want. You can take a look at this document for more information.
ISA Server 2004 System Policy[^]
Also, you can find the resources from the sites provided in my previous reply:
http://www.microsoft.com/isaserver/techinfo/guidance/2004/configuration.mspx[^]
http://www.isaserver.org/[^]
|
|
|
|
|
Thanks again!I'll look up the reference!
|
|
|
|
|
I have a mainpage that will load a ascx and within this ascx I have also a few RequiredFieldValidator. This work fine until I try to load a button server control to acts as a close window button ('X'). This button will try to dispose off the ascx but due to RequiredFieldValidator it does not postback and unload the ascx. How can I achieve this task with Javascript? Can anyone help?
TIA
|
|
|
|
|
Hi there,
You simply set the CausesValidation property of the button to false to make sure that all the validators will be ignored when you press the button.
|
|
|
|
|
Hi minhpc_bk.
Thanks for your help, the solution works. Again thanks a lot. As an alternative, I did actually saw a block of javascript solution for my problem mentioned earlier, but unfortunately I lost it. If you have the Javascript solution, please do tell me.
Thanks again.
|
|
|
|
|
Alternatively, you can use the javascript to disable all the validators stored in the Page_Validators array, and this script is registered to the onclick event of the web server button. I'm not sure it's that what you saw earlier.
|
|
|
|
|
is there a way to do this? I have a data capturing program that I'm writing where we host our own webbrowser object on a vb form. when the user submits info on a specified page, the info is also saved in the legacy sql server database. there's validation that we can impose for the sql server stuff, but the rest of the validation is done through javascript on the page. Is there a way to access the values of javascript variables through the webbrowser object so that my app can know whether or not it validated through their checks also. we only want the stuff saved in the sql server database if it validates through their javascript code also. any help is appreciated
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
Hi there,
IMO, you are not able to directly access a javascript variable through the webbrowser object, however, with the webbrowser control you basically can access all html elements on the web page. So you can save the value of a javascript variable in a hidden element, then you can retrieve the hidden element via the webbrowser object. One more thing that you also need to specify when the application can access the hidden element. The sample code below demonstrares how to get the value of a hidden element when the button is clicked:
....
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)axWebBrowser1.Document;
mshtml.HTMLDocumentEvents2_Event iEvent = (mshtml.HTMLDocumentEvents2_Event) doc;
iEvent.onclick += new mshtml.HTMLDocumentEvents2_onclickEventHandler(iEvent_onclick);
...
private bool iEvent_onclick(mshtml.IHTMLEventObj e)
{
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)axWebBrowser1.Document;
mshtml.IHTMLInputHiddenElement hidden = (mshtml.IHTMLInputHiddenElement)doc.getElementById("hiddenID");
MessageBox.Show("Value: " + hidden.value);
return true;
}
|
|
|
|
|
Thanks. But the problem is that we aren't able to change the web page because it's made by a third party, so we can't add hidden elements to the page (or any elements, for that matter). The user has to put client info into a state database through their website, and they used to have to put all that same info into their own database. our program just captures it before it's submitted so that they don't have to input the data twice. we don't have any control over how the website is made.
My articles
www.stillwaterexpress.com
BlackDice
|
|
|
|
|
Somehow I missed the IHTMLWindow2::execScript[^] method which is able to execute the specified script. To query the value of a global variable, you can provide some script to perisist the value of the global variable somewhere for example the clipboard of the window object or any other properties:
mshtml.HTMLDocument doc = (mshtml.HTMLDocument)axWebBrowser1.Document;
mshtml.IHTMLWindow2 win = doc.parentWindow;
object obj = win.execScript("window.clipboardData.setData(\"Text\",Page_IsValid.toString());","javascript");
mshtml.IHTMLWindow3 win3 = (mshtml.IHTMLWindow3)doc.parentWindow;
object pageIsValid = win3.clipboardData.getData("Text");
|
|
|
|
|
May be they dosen't provide the permission to write to that directory?
|
|
|
|