|
This is probably a dumb question (ducks) but I just wrote my first application to actually use a .NET Web Service to retrieve content. It was really very easy to do and I like it alot... but .NET is actually going a step further than I really need it to. In my case, I actually WANT the raw XML response that's coming back from the web service. However, .NET is appropriately using the WDSL to package the response into a member of variable of the specified return type... which is really nice... if I needed that. Can anyone help me get at the XML response itself?
|
|
|
|
|
using System.Net;
WebRequest webrequest = System.Net.WebRequest.Create("url");
WebResponse webresponse = webrequest.GetResponse();
etc ....
|
|
|
|
|
I am building a web application with three user controls on the default page. From the page the user enters some data and clicks a button. The click of the button assigns a modular level variable the entered data, which is then used to populate the three user controls. If incorrect data has been entered I want to set the visibility of the user controls to be false from the click event on the default page. The user control gets added on the load of the default page with the following code.
ContentPane.Controls.Add(Page.LoadControl("~/Modules/ucCustomers.ascx"))
I tried the following code, but have run into errors. I’m not sure if it is moving in the correct direction or not.
Dim ucCustInfo As Control = FindControl("~/Modules/ucCustomers.ascx")
ucCustInfo.Visible = False Also have tried:
Dim c1 As Control = LoadControl("~/Modules/ucCustomers.ascx")
c1.Visible = True
I appreciate any help you can provide me. If you’re a C# programmer and can help feel free to do it in C# I will port it.
Jason W.
|
|
|
|
|
After getting seriously frustrated I discovered a way to accomplish what I want. It isn’t exactly what I was trying to do but the results are the same and that is all that matters.
Answer: Rather then setting the visibility of the user control itself, I can set the visibility of the place holder that the control has been added to.
Jason W.
|
|
|
|
|
Let´s assume that I have a page with lots of trace code, being tested by the IsEnabled property of the Trace context. Something Like this:
<br />
If Trace.IsEnable = True Then<br />
Trace.Warn("Warning ! Page meltdown !")<br />
Trace.Write("Call thy fireman !")<br />
End If<br />
<br />
'*** Some Code Here<br />
<br />
If Trace.IsEnable = True Then<br />
Trace.Warn("More tracing")<br />
Trace.Write("More Messages")<br />
End If<br />
When I enable the trace, it will be display in the page or in the page file.. blá.. blá.. blá.
My question is: If I Disable the Trace, is the "IsEnabled" test code and the Trace.Write/Warn code included in the compiled version of the page ? If it is, does it impact much on performance ? Does anyone benchmarked a page with trace code and trace disabled ?
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
I've gone sending to outer space, to find another race
|
|
|
|
|
"My question is: If I Disable the Trace, is the "IsEnabled" test code and the Trace.Write/Warn code included in the compiled version of the page ? If it is, does it impact much on performance ? Does anyone benchmarked a page with trace code and trace disabled ?"
The IsEnabled test and the Trace.Write code will be in compiled version of the page. But it won't affect performance that much. I only tested writing trace messages to a file, you can easily write over 20000 messages by multiple threads within a second.
|
|
|
|
|
Anonymously wrote:
by multiple threads within a second
How many ? I´m asking becuase my system have a extremly high access per second rate.
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
I've gone sending to outer space, to find another race
|
|
|
|
|
i have checkboxes which may return multiple results:
Decision Maker
Buyer&
Advisor
Also in my DB, there is a field for each with a yes/no value depending on if box is checked or not.
how do i enter the values into the fields in the DB as Request("Role") returns multiple values, each separated by a comma so the following (for example) cannot be used.
if Request("Role") = "Q4C2" Then
RS("Buyer") = True
end if
thank you!
|
|
|
|
|
Try something like this...
Dim MyArray
' pretend Role equals "1,0,1,0"
MyArray = Split(Request("Role"), ",")
For x = 0 To (UBound(MyArray)-1)
' update each record in recordset here
'
' i.e.; RS("Buyer") = CInt(MyArray(x))
' RS.MoveNext
'
' ...
Next
Jeremy Falcon
Imputek
<nobr>"In fact it is quite simple, men and women both only want one thing - what they can't have!" - phykell
|
|
|
|
|
in my database i have a yes/No checkbox. the asp code in relation to this is 2 radio buttons, the values for both are "yes" and "no". How do i code so teh checkbox in the database is checked if "yes" and left unchecked if "no"?
thank you!
|
|
|
|
|
Set their values to 1 for yes and 0 for no. In JScript use parseInt() to convert it to an integer and in VBScript use CInt() . Store the result in the database.
Jeremy Falcon
Imputek
<nobr>"In fact it is quite simple, men and women both only want one thing - what they can't have!" - phykell
|
|
|
|
|
mcm wrote:
How do i code so teh checkbox in the database is checked if "yes" and left unchecked if "no"?
Not sure if Jeremy answered your question as I think you are asking for how to do it the other way, right?
Basically when you pull the yes/no value from the database you do something like the following in your ASP page:
<input type="checkbox" name="chkYesNo" <%If rs("field") = "yes" Then%>checked="true"<%end if%> />
Inlining ASP is not a good idea, but that is one way to do it. You could also use JavaScript with the OnLoad event.
|
|
|
|
|
Uf.. I'm really tired from VS.NET, can't find anything there and my old projects are not working in .NET
I have several projects I did using InterDev from VS6. Firstly couldn't open them in .NET so re-created. Now it just not working well, I guess I need to figure out settings, but can't find anything yet.
When I navigate to some pages, the browser doesn't show them, but continue to download, looks like there is an error or something, although I'm sure there is no error, since same code is working well on my web site and worked with InterDev fine. If I'll cancel loading the page, I'm not able to use IIS until i'll restart it. Can someone tell me why this happen and how to fix this?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
At least found now where the problem is. Maybe someone knows how to fix it?
I have such line in the ASP page:
set fso = Server.CreateObject("Scripting.FileSystemObject")
set dir = fso.GetFolder(strCurDir)
So exactly on this line IIS stops working. I got no error, nothing. Just IIS stops working at all. Parameter is correct, I gave even Full Access to Internet Guest Account, so security is not a problem... But what?
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
|
I have the following snippet of code, but I do not desire the horizontal scroll bars to be there...the text word wraps fine and doesn't need them...is there a way to hide H scroll bars...?
<div style="position: relative; width: 280px; height: 80px; overflow: scroll">
This is some text
</div
I think I have accomplished this before using a word wrap CSS attribute or something, but I cannot remember if it is available how I did this...?
Any ideas...? Thanks!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
I think I have accomplished this before using a word wrap CSS attribute or something, but I cannot remember if it is available how I did this...?
It is a bit odd but you need to set overflow to auto not scroll .
|
|
|
|
|
Thanks!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I just finished an ASP.NET application and it runs fine on my dev machine.
However, when I deploy it to the servers (clustered), I get the error "The View State is invalid for this page and might be corrupted". The crazy thing is that I set EnableViewState to "false" .
Also, I made sure the MachineKey and ValidationKey values are the same across all nodes in the cluster.
Any hints?
|
|
|
|
|
Just for future reference, really. I don't see much regarding perl out here, but that doesn't necessarily mean folks aren't using it.
Also, does anyone know good perl discussion boards similar to code-project?
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
I'm looking for the best way to restrict access to files, such as word docs, pdf, under an ASP.NET application. I use forms based authentication to allow access and I've set the IIS file mappings for my application so htm and asp pages use the ASP.NET dll. Everything works fine with these but doc and pdf files still get no security.
I was trying to implement an httpmodule to handle the onbeginrequest and check if the user has been authenticated but at that point in the process the user object has not been created yet. Anyone have an idea how to do this?
|
|
|
|
|
Mark Nischalke wrote:
I'm looking for the best way to restrict access to files, such as word docs, pdf,
Best way is to do it per folder, not per file (so copy the PDFs and DOCs into the secured folder(s).)
In IIS go to the Directory Security tab of a virtual dir. properties. Then uncheck Anonymous access and check Basic Authentication. When you access that dir from an account not on the servers domain it will pop-up a dialog asking for a user name and password.
The problem with this though is you need a Windows account for users to use, though I think you can tap into it and link it through to a database rather than Active Directory.
|
|
|
|
|
I've used this in other projects but for this it won't work. These fles are in secured folders. The user had to pass through the forms authentication to view the aspx and html pages under it which contain links to the docs and pdfs. It is to much to ask (I have the scares) them to authenticate again to view a doc or pdf. As it is now navigating to the main page routes them through the authentication, just as it should. navigating the the doc directly does not. I want to check the authentication status, if not present redirect them tot he login page.
|
|
|
|
|
This problem perhaps is an impossible-to-answer qustion!
Well, I've uploded my ASP.NET code on Brinkster to ty it.... but it doesn't work!
I get this error message when I enter the page:
<br />
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. <br />
<br />
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.<br />
<br />
Source Error: <br />
<br />
<br />
Line 1: [configuration]<br />
Line 2: [system.web]<br />
Line 3: [authentication mode="Forms"]<br />
Line 4: [forms loginUrl="LoginPage.aspx"]<br />
Line 5: [credentials passwordFormat="Clear"]<br />
<br />
I've done a "Log in" test page with forms authentication, but it doesn't work for me on Brinkster. Can Brinkster's server be the leak?
PS. This is the address: http://www21.brinkster.com/suza/[^]
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
This error can be caused by a virtual directory not being configured as an application in IIS.
Another irritating thing about ASP.NET. With ASP you just copied the file and it ran, with ASP.NET you have to maintain the integrity of the whole assembly and a whole lot of other setup tasks.
Basically this is what you need to do: You need to get Brinkster to make the IIS Virtual Directory in which your web.config file lies an Application. This can be done in IIS itself (right click virtual dir, click Create Application.)
If Brinkster won't do this for you (which they probably won't) then you need to locate your web.config file in an application folder, not just a normal folder. Bottom line is web.config must be in a virtual dir which is an IIS Application. Very bizarre but that is the deal unfortunatley.
|
|
|
|