|
Is there any way of customising trace functionality so that you *only* see
the output you've specifically written and not all the other stuff?
Kevin
|
|
|
|
|
In ASP.Net, what is the a rule of thumb as to when you use server-side controls (e.g. <asp:Table> ), and when you use regular HTML elements (e.g. <table> )?
|
|
|
|
|
There's a help topic called "Recommendations for Web Controls vs Server Controls" or something, in the VS help. This will also be in the online help msdn.microsoft.com/library.
Roughly - use HTML server controls when migrating existing pages.
Use asp web controls if you want a more type-safe programming model (more properties). Also you can automatically detect which browser is being targeted. You can't do this with server controls.
Kevin
|
|
|
|
|
Hi guys, totally stumped (again). I'm experimenting with session state using SQL Server (2000). I ran InstallSqlState.sql to create the ASPState database. That went fine.
BUT, I am using Windows Authentication and now I don't know what the "sqlConnectionString" attribute of the sessionState element in my Web.Config file is supposed to look like.
I have granted my Windows login account access to the ASPState database but no combination of entries into the "sqlConnectionString" seems to work. Running the app just gives me a
"System.Data.SqlClient.SqlException: Login failed for user 'blah'. Reason: Not associated with a trusted SQL Server connection."
Not too experienced yet with setting up SQL Servers but I think I've tried everything I know and/or read so far.
Has anybody managed this??
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
Are you running SQL and IIS on the same server?
I had major problems when running IIS on my machine local, trying to connect to a SQL database on a different server. (Standalone server, no domain)
Michael
|
|
|
|
|
Thanks for the response Michael, yes I'm running the two on the same machine. I won't be getting a new PC till late next month
All the samples I've seen show the connection string based on the fact that they are using SQL Authentication.
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
You need to give the machinename\ASPNET account access to the SQL Server's ASPState database.
There should be a version of the correct SQL Connection string in the machine.config file located in %WINDIR\Microsoft.NET\%Version%\Config\
HTH,
James
Simplicity Rules!
|
|
|
|
|
|
Hi James, I tried out your suggestion. First thing I learned (belatedly) is that the Web.Config file sections override the corresponding sections of Machine.Config files for a particular application. Since the default state mode in the Machine.Config file refers to in process handling of session state, the default connection string is provided as such. So it didn't help, especially as I was using Windows Authentication for my SQL Server installation.
Anyway, to cut a long story short, I ended up totally screwing up my database permissions and logins, to the point where I gave up and decided to take a deep breath and start over. I basically switched to SQL Server Authentication and used the "sa" account to connect to ASPState and everything worked fine. I still think it's a bit wierd that using any other account proves to be such a pain. If you have managed to do this though, I suggest you write a brief step by step article about it because there are probably others out there like me gritting their teeth over the same thing.
Thanks again.
Senkwe
Just another wannabe code junky
|
|
|
|
|
Odd, this e-mail came to me as bounced so I didn't see it until now when I saw it sitting there and almost deleted it :-P
I haven't tried using SQL Server for session state, yet I will probably experiment with it once I find a cheap host for ASP.NET, my current host only does PHP and ASP (via an apache module).
James
Simplicity Rules!
|
|
|
|
|
Hello crowd. I'm having some serious issues with my coding.. Can anybody please take a look at this and tell me what's wrong?? Thanks...
First of all, the C# code-behind file that's causing my headaches:
[code]
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 tracker
{
/// <summary>
/// Summary description for adtracker.
/// </summary>
public class adtracker : System.Web.UI.Page
{
String strReferrer = "";
protected System.Web.UI.WebControls.Label labelMessage;
private void Page_Load(object sender, System.EventArgs e)
{
Uri uriReferrer = Request.UrlReferrer;
strReferrer = uriReferrer.ToString();
labelMessage.Text = strReferrer;
}
#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);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
[/code]
And the HTML/ASPX display file, which doesn't really matter, but I'm including it for reference anyways. It just contains my Label (labelMessage) which I'm using for debugging purposes.
[code]
<%@ Page language="c#" Codebehind="adtracker.aspx.cs" AutoEventWireup="false" Inherits="tracker.adtracker" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>adtracker</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">
<LINK href="http://mail.forbrukerkraft.no/fkweb/webinterface/styles/main.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form id="adtracker" method="post" runat="server">
<asp:Label id="labelMessage" runat="server" Width="139px">Label</asp:Label>
</form>
</body>
</HTML>
[/code]
Now - I'm constantly getting a System.NullReferenceException on this line:
[code]
strReferrer = uriReferrer.ToString();
[/code]
- which stumps me, since I've properly declared the strReferrer String object further up in the code, as you can see above.
There seems to be a serious gap in my knowledge somewhere here.. Can anyone try to do this on their own machine and tell me what happens? (obviously the referrer will be blank if you don't link it up from somewhere and click on the link - but that doesn't really matter - does it???)
Thanks for any help you can provide...
Henning Kilset Pedersen
Forbrukerkraft AS
IT Manager
|
|
|
|
|
When you say:
Response.Expires = -1
what exactly gets written to the HTTP header?
I'm trying to get my page to expire immediately for IE. For Netscape I can just use the "Pragma: no-cache" meta tag, but it doesn't work for IE. The problem is that I'm using JSP, not ASP, so there's no equivalent to the Response.Expires method. If I can figure out what gets written to the HTTP header, I may be able to simulate it with JSP.
Thanks in advance for your help!
Alvaro
Intellectuals solve problems; geniuses prevent them. - Albert Einstein
|
|
|
|
|
I think for IE <meta http-equiv="EXPIRES" content="May 31,2001 13:30:15"> is working fine. Never used it though, but I found it in MSDN
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
I'm using the following:
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" + "C:\personal.mdb")
And i'm getting the following errors...?
ADODB.Connection error '800a0e7a'
ADO could not find the specified provider.
How can I find the current PROVIDER version on my computer if it exists at all...?
Where would I download the newest version...?
Or am I missing something totally here as to why my webpage won't connect with the DB...?
Thanx in advance!
Cheers
p.s-I have Acess 97 on my computer and the connection string(???) is for a access 97 db...so whats the deal...? Do I have to set it up through control panel some how...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
So I did some research and it turns out
Microsoft.Jet.OLEDB.3.51;DATA SOURCE
is the proper connection string for access 97 datbases and the one above is for Access 2000...???
My book says one thing and 3 sites I just visted says the other...???
Anyway...I tried this new connection string and still no luck, so i'm still baffled as to how to make this work.
I'm using and ASP script on PWS win 98 w/ access 97 installed...
Anyone have any ideas...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Yippy
I just figured it out!
I used the following:
DB.Open ("Provider=Microsoft.Jet.OLEDB.3.51;Data Source=" + "C:\PCSpectra.mdb")
And it works I think...
DATA SOURCE isn't the same as Data Source....cuz thats all I changed
Also I originally tried:
DataSource and that caused a "Couln't find a valid ISAM"
Or something like that...
Anyways...hopefully everything works now.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
It is old though. Upgrade your database components. I believe MDAC is what you need to upgrade. Go to Microsoft's site and search for MDAC download
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
How to debug a COM object called from ASP?
Server-side I mean
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
I don't think you can debug the actual COM object. When I need to debug my COM components I fake it - I created a VB project and copied the COM component's code to the form, then in form_load I called the function I need to debug.
|
|
|
|
|
Greetings,
I am having problems getting access to registry information from an ASP page.
I have a web server set up with an ATL com object that queries the registry for information. On this web server I have an ASP page that calls the registry com object from script.
My problem comes in when I have a computer on a the same local network make a call to the asp page to get information from the web server's registry. No information is returned from the registry(if I hard code values in for the registry values that I return they get returned via the ASP page). It seems like there is a security issue, but I am not sure. Any suggestions?
Thanks in advance.
|
|
|
|
|
I hate having a problem, and being stuck on it for awhile, making a post, and right after making the post for help I find the solution.
The solution is to adjust the properites of the ASP page in Web Services under "file security", and select a user that has administrator access rights to login as. Pretty simple to do, but it took awhile to find.
|
|
|
|
|
Nice, good to know, I will need it too soon
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
Need Web-based database administrator? You already have it!
|
|
|
|
|
Excellant, I am glad my post could help!
|
|
|
|
|
i have a parent window.from that i move to a child window(a popup).then i add records to database.the child window has two textfields to enter the data.After the data is entered,the user clicks the submit button and the page is taken to a page where database is updated and after updation the user is redirected to the child window.
what i want is as soon as updation takes place in the database,the parent window should be refreshed and changes shud be shown in parent window.i don't want to use <meta> tag.
please reply soon.
|
|
|
|
|
<script>
window.opener.location.reload();
</script>
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|