|
Publish your website on IIS in ASP.NET page: http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx
1. webvidu asp.net to run in normal mode and programming Publish normal website
2. Publish test their IIS under ASP.NET on IIS website, follow the instructions above also normal
3. When put up IIS and web browser they type in localhost/asp shall be the following error:
XML Parsing Error: not well-formed
Location: http:
Line Number 1, Column 2:<%@ page theme="Default" language="C#" masterpagefile="~/MasterPage/MasterPage.master" autoeventwireup="true" inherits="webvidu._Default, App_Web_default.aspx.cdcab7d2" %>
-^
I do WinXPSP2 IIS on the operating system, and use vs.net2005 13.0.1 firefox browser
so please fix this bug? thanks
|
|
|
|
|
One possible reason: Check if correct .NET Framework is selected in IIS. For example, it might be set as v1.1 right now but v2.0 is needed.
|
|
|
|
|
I do not think NetFramework because my web host is the same machine.
|
|
|
|
|
So what? In your IIS you might have forgot to set the correct Framework version. Please check.
|
|
|
|
|
I've modified the above error, machine error follows:
Server Error in '/asp' Application.
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492170
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
System.Web.CachedPathData.GetConfigPathData(String configPath) +382
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetApplicationPathData() +68
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385679
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
|
|
|
|
|
|
Hi,
when I start debuge a web solution, this message appear,even if solution was a empty web form,
what should I do...?
I use visual studio 2010 & windows 7.
modified 25-Jun-12 11:57am.
|
|
|
|
|
|
Thanks for guides... I read that, but that's not helpful…
Actually I reinstall windows at last, and before installing VS, I install IIS by all categories.
That's worked.
|
|
|
|
|
In a C# 2010 web form that uses a formview control, I am comparing 2 dictionary objects to see if their values are different, right before the actual change occurs in the database. The code is comparing the old dictionary value to the new dictionary value to see if the value has changed. If so an 'invalid' date field is being set.
However the problem is the values are actually the same. By stepping through the code, the application thinks the values are different. Can you tell me what is wrong with the code listed below:
protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
if (e.NewValues["Cutoff_Date"] != e.OldValues["Cutoff_Date"])
{
e.NewValues["Invalid_Date"] = "Y";
}
}
|
|
|
|
|
First thing you should check is the whether formview is getting databound on each postback or only one first postback . because if it is getting databound on each postback then you will have to make it do that only on first load and not on each postback .
If that doesn't work then, My suggestion is that you handle the ItemDataBound event too. get the value in this event and save it somewhere (like session variable). then in this event get the new value and compare it with the one in in session variable.
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.
|
|
|
|
|
When comparing text, you have to do a compare against the actual values of the text, and not the string representations held in e.NewValues and e.OldValues. That type of comparision is good for numbers, or short text such as "GOOD" or "BAD"
So text is really stored as a byte array like 37 80 68 70 45 49
Doing a String.Compare will examine the byte array of the strings, and give you an accurate result.
In your case, I don't what the values are, but NewValue != OldValue will not produce a consistent result.
If String.Compare(path, 0, "file:", 0, 5, True) = 0 Then
Return True
Else
Return False
End If
classy_dog wrote: However the problem is the values are actually the same. By stepping through the code, the application thinks the values are different.
You lost me here. You know the values are a match, but stepping through the code shows you different values.
I going to go with an inaccurate result being produced by your comparison
|
|
|
|
|
classy_dog wrote: By stepping through the code, the application thinks the values are different.
That's because you are comparing the values of the objects and not their content. You need to do a String.Compare() [^] to compare the string data; the == and != operators will merely tell you whether the two references point to the same or different objects.
[edit]
Well I was wrong as, according to MSDN[^] strings are a special case. I can only conclude that the dictionary is not returning string s in the sample you showed.
[/edit]
|
|
|
|
|
I knew you had to do a string.compare, and some of the details of it, but didn't think of his code as comparing objects, and not the actual value.
Nice Answer!, I even learned from it.
|
|
|
|
|
According to this[^] it looks like I was wrong. Time for a big slice of crow pie, followed by some C# testing.
[edit]
I suspect the dictionary that OP is using, does not return pure strings in the sample shown.
[/edit]
|
|
|
|
|
We got a little debate going on here in this rodeo cowboy
I read the reference you pointed to, and I must support your first argument regarding comparison operators and objects
Operator B for string b = string.Copy(a) returns false, but a and c returns true
string a = "hello";
string b = String.Copy(a);
string c = "hello";
Console.WriteLine(a == b);
Console.WriteLine((object)a == (object)b);
Console.WriteLine((object)a == (object)c);
Anwsers:
True
False
True
[edit]
The op took a shortcut by using an operator against the objects, and failed to create 2 new buffers to store the actual values he needs to string compare.
I threw a little c++ lingo in there.
|
|
|
|
|
Casting the string s to object s means that the == operator will compare their addresses to see if they point to the same object (same as comparing two pointers in C++). As I said, I suspect that the dictionary indexing operations do not return 'pure' strings.
|
|
|
|
|
Oh! OK, I understand now. pure strings
|
|
|
|
|
|
I forgot to mention,
After working in c++ using the strcmp macro, and walking through it a hundred times, I get a pretty good idea of how it works, how the strings are actually compared down to the byte value for an exact match.
But in the case of asp.net whether it's vb or c#, I assume the string.compare uses a similar method of comparison down low underneath. I suppose one could write something similar using bytes in vb or c#.
I've never been able to walk through an operator, to see what it really does.
But I think your right about the OP just compared object pointers, and got a match.
|
|
|
|
|
Hi,
Have you ever been in a situation where you needed a scheduled task to kick off, but you didn’t have access to the server (think shared hosting)? I originally saw this hack on Samir’s blog about a year ago now.
Essentially, you just create a System.Timers.Timer in the Application_Start event of your global.asax, and bam – instant scheduled task! I don’t necessarily recommend this, but I guess if you had no other option it could work.
using System.Timers;
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
Timer timer = new Timer(1000);
timer.Elapsed += (object s, ElapsedEventArgs args) =>
{
LetsDoSomethingAwesome();
};
timer.Start();
}
}
Thanks & Regards
--AK
|
|
|
|
|
You have been a member here long enough to know that these forums are not for this type of message. Please follow the site protocol.
|
|
|
|
|
Plagarized from http://codeharder.com/?tag=/hacks[^].
If you are going to copy/paste someone else's work, you must provide credit to the original source.
I wasn't, now I am, then I won't be anymore.
|
|
|
|
|
I have a question about using session variables since this is the first C# 2010 web form app that I am running.
Right now I am passing 3 session variables between 2 web pages in the web application that I setup. This is a data entry application where some information is entered on page 1 and the rest of the information is entered on page 2.
When the user has finished entering the information for the first customer. Now the user will be ready to setup information for the second user.
From what I have seen on the internet session variables last up to 20 minutes. Thus I basically do not want the information saved from customer 1 to be entered into the database file for customer 2 by using session variables.
Thus to prevent this from occuring, I am coding the following before the user clicks the button to enter data for the next customer:
Session.Remove("var1");
Session.Remove("var2");
Session.Remove("var3");
Response.Redirect("~/page1.aspx");
Can you tell me if this is the best method for clearing out session variables and/or if there is a better process you would recommend? Can you tell me and/or point me to a reference that will explain your answer to me?
|
|
|
|
|
try to use session timeout.Sometime,network is not well and session has not remove.
|
|
|
|