|
anyone can help?
'/aspx' 應用程式中發生伺服器錯誤。
-----------------------------------------------------------------------------
DataBinding: 'System.Data.DataRowView' 沒有包含名為 '書名' 的屬性。
描述: 在執行目前 Web 要求的過程中發生未處理的例外情形。請檢閱堆疊追蹤以取得錯誤的詳細資訊,以及在程式碼中產生的位置。
例外詳細資訊: System.Web.HttpException: DataBinding: 'System.Data.DataRowView' 沒有包含名為 '書名' 的屬性。
原始程式錯誤:
只有在偵錯模式編譯時,才可以顯示產生此未處理例外狀況的原始程式碼。若要啟動,請依照下列步驟之一,然後要求 URL:
1. 將 "Debug=true" 指示詞加入產生錯誤的程式碼頂端。例如:
<%@ Page Language="C#" Debug="true" %>
或:
2. 將下列區段加入您應用程式的組態檔:
<configuration>
<system.web>
<compilation debug="true">
請注意: 第二種技巧會導致在偵錯模式下編譯指定應用程式中的所有檔案。第一種技巧只會造成在偵錯模式下編譯該特定檔案。
重要資訊: 在偵錯模式下執行應用程式會過度耗用記憶體/效能。在實際執行部署之前,應該先確認應用程式已經停止偵錯。
堆疊追蹤:
[HttpException (0x80004005): DataBinding: 'System.Data.DataRowView' 沒有包含名為 '書名' 的屬性。]
Microsoft.VisualBasic.CompilerServices.Container.InvokeMethod(Method TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags) +272
Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container BaseReference, String MethodName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, BindingFlags InvocationFlags, Boolean ReportErrors, ResolutionFailure& Failure) +196
Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn) +216
ASP.bookstore_default_aspx.Data_Bind(DataView DView, Object BindObject) +91
ASP.bookstore_default_aspx.Cart_Add(String Title, String Price) +823
ASP.bookstore_default_aspx.AddBookToCart(Object sender, DataGridCommandEventArgs e) +247
System.Web.UI.WebControls.DataGrid.OnItemCommand(DataGridCommandEventArgs e) +105
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +77
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +117
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +115
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +163
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
--------------------------------------------------------------------------------
版本資訊: Microsoft .NET Framework 版本:2.0.50727.42; ASP.NET 版本:2.0.50727.210
|
|
|
|
|
Dear friends,
i have problem in accessing the controls added in webpart declarative catalogue,in what event on webpart , i can define and add the controls in declarative catalogue part.
i hope i will get answer from your side.
Best regards
|
|
|
|
|
Hi,
I have an Asp.Net application that gets price feeds for different stocks via a dll-binary.
When running the application in visual studios built-in ASP.NET Development Server, it works fine, but when i publish the application the function that gets the feed doesn't work. To be sure i set impersonate to true and run as a local administrator but it still wont work.
What else is the difference between running an application in IIS and in visual studios built-in ASP.NET Development Server that could cause a problem as this.
Im thankfull for every tip i can get.
Regards
Hmitosh
|
|
|
|
|
but what problem? is access denied?
<< >>
|
|
|
|
|
The problem is that the method returns 0 instruments instead
of 1 as it is supposed to. It executes the method so there doesn't seem to be an access problem. The object containing the method is a legacy com object. Could it be that IIS has problems running COM-objects.
Regards
Hmitosh
|
|
|
|
|
Apparantly the COM object is listening on a port for incoming data.
could it be that IIS blocks the port. In that case is there a way to ublock the port.
Regards
Hmitosh
|
|
|
|
|
if so, you can check your COM able to listen successfully on that port? or it's already registered by another program? or it's blocked by some firewall or something like that...only you might know
<< >>
|
|
|
|
|
I forfot to say. But it works fine when i run in Visual Studio Built in Web Server, it doesn't work when i run it on IIS on the same computer. That means that there is some difference in the way the theese two web services works.
My thought was that there is a problem having a com object running in IIS that listens on a another port but i havent been able to find out.
Regards
Hmitosh
|
|
|
|
|
Hi All
I have a problem with maintaining view state in WebCustomControl.
The problem is that i want to create a generic search control.
All controls that is used in search criteria is passed from hosting page
e.g
TextBox txt1 = new TextBox();
TextBox txt2 = new TextBox();
TextBox txt3 = new TextBox();
Control[] c ={ txttest, txt1, txt2, txt3 };
SearchControl.WebCustomControl1.AddControls(c);
Where Add control is Satic method in webcustom control
its code is as
public static void AddControls(Control[] Controls)
{
UIControls = Controls;
}
where UIControls is static Control array defined in Custom control
I then Render the control as
protected override void RenderContents(HtmlTextWriter output)
{
output.Write("");
for (int i = 0; i < UIControls.Length; i++)
{
output.Write(" ");
output.Write(" ");
output.Write(" ");
}
output.Write(" ");
output.Write(" ");
output.Write(" ");
output.Write("");
UIControls[i].RenderControl(output);
output.Write(" | ");
output.Write("");
output.Write("");
output.Write(" | ");
}
Now the problem is that when i access any of the control, its value is lost!
Any one that can help me plz
regards
|
|
|
|
|
Is there a way to access the .Text value of a Textbox control on the Masterpage from one/all of its Contentpages. If not, what is the best way to share data between pages.
I am using VWD Express.
Thanks,
RickD
|
|
|
|
|
If you set the MasterType Page directive, then your page will know what kind of master page it is in. Then you should be able to access controls on the master page.
<%@ MasterType virtualpath="~/Masters/Master1.master" %>
Here is some sample code from microsoft help:
Visual Basic
<pre>
Sub Page_Load()
Dim mpContentPlaceHolder As ContentPlaceHolder
Dim mpTextBox As TextBox
mpContentPlaceHolder = _
CType(Master.FindControl("ContentPlaceHolder1"), _
ContentPlaceHolder)
If Not mpContentPlaceHolder Is Nothing Then
mpTextBox = CType(mpContentPlaceHolder. _
FindControl("TextBox1"), TextBox)
If Not mpTextBox Is Nothing Then
mpTextBox.Text = "TextBox found!"
End If
End If
' Gets a reference to a Label control not in a
' ContentPlaceHolder
Dim mpLabel As Label
mpLabel = CType(Master.FindControl("masterPageLabel"), Label)
If Not mpLabel Is Nothing Then
Label1.Text = "Master page label = " + mpLabel.Text
End If
End Sub
</pre>
C#
<pre>
void Page_Load()
{
// Gets a reference to a TextBox control inside
// a ContentPlaceHolder
ContentPlaceHolder mpContentPlaceHolder;
TextBox mpTextBox;
mpContentPlaceHolder =
(ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
if(mpContentPlaceHolder != null)
{
mpTextBox =
(TextBox) mpContentPlaceHolder.FindControl("TextBox1");
if(mpTextBox != null)
{
mpTextBox.Text = "TextBox found!";
}
}
// Gets a reference to a Label control that not in
// a ContentPlaceHolder
Label mpLabel = (Label) Master.FindControl("masterPageLabel");
if(mpLabel != null)
{
Label1.Text = "Master page label = " + mpLabel.Text;
}
}
</pre>
Hope that helps.
Ben
|
|
|
|
|
Thanks Ben,
That did the trick....
|
|
|
|
|
Hi every one,
I need to call a method resides in another .aspx file from another .aspx file (all in the code behind)..
I tried making it public and static but still I can't access it, I can solve my problem if I could make the second page to post back when the first one do post back..
Any suggestions??
Thank You very much
|
|
|
|
|
You need to place your function (which you want to call in more than one pages) in a separate class, then make an instance of that class in your page and call that function. Simple Object Oriented Programming
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
mubashir is right
You need to Crerat a separate class
inside the class create a satic Method e.g
Public static void MyFunction()
{
//some code
}
the function can be then call in many pages
Note: The class must be of public scope
|
|
|
|
|
I can't do that bcus I wanna call "Page_Load" function of that page!!
|
|
|
|
|
What I did one time was create a interface with a execute method. Then add the interface to your page and then place a call to the Page_Load in the execute method. Then where you want to use is create a instance of the page and use the execute method.
I hope this is usefull.
|
|
|
|
|
Hi fellows,
I built a simple custom calendar control on my Web Application. Now how can i build a dll file so i don't have to carry the source code file from one project to another project. Can someone show me step by step or any link.
Thanks
|
|
|
|
|
when you build the project, a dll of your project name will be automatically created in bin/debug folder.
you have to copy the dll from this directory and add it to the bin of your other project. then in VS.net , right click on project and add reference, then browse and go to the location where you copied the dll. now add it, in toolbox menu you will get a control of you specified project/class name.
|
|
|
|
|
You can just compile the .cs file by selecting the target as a library and it will be compiled to a .dll
This is done in Command Prompt.
c:\> csc /t:library hello.cs
You don't have to be AFRAID!
|
|
|
|
|
I have an ObjectDataSource, and find it a convenient way to simply bind data to grids.
I regularly design classes to take object injections on pageload so that i don't have to create duplicate instances, i.e. DataAdapters / security permissions data. However, i can't seem to get to the internal DataSource object inside the ObjectDataSource, which is really annoying.
Is there any way to do this?
Regards
Tris
|
|
|
|
|
|
Hi ben,
Thanks for the feedback, but i'm not looking for data retrieval, i can bind to the grid. I just want to get a reference to the object that the ODS constructs in order to perform its functions. It's not exposed in any properties that i can see.
Cheers
Tris
|
|
|
|
|
hi all,
I am new to asp.net2.0, can u plz tell me where our website dll store. and can we add that dll to our new web site for reusability.
k.ravi sankar
|
|
|
|
|
If you have a project that you have included in your solution for your web site the dll will be in the bin directory of your web site.
Ben
|
|
|
|