|
|
when i run this code it show an error "RecievingDate is neither a DataColumn nor a DataRelation for table ." i check the query it has ReievingDate still it show error
<asp:TemplateField HeaderText="Date" HeaderStyle-HorizontalAlign="Left" SortExpression="RecievingDate">
<ItemTemplate >
<asp:Label ID="lbl1" runat ="server" Text ='<%# Bind("[RecievingDate]") %>'></asp:Label> </ItemTemplate>
|
|
|
|
|
I guess ther is wrong with your Data Source. Please validate the Data Source properly. and Check "RecievingDate" is there or not. Are you getting any inner exception ?
|
|
|
|
|
when i run this code it show exception that at same line of code "Exception has been thrown by the target of an invocation." and when from solution explorer i view it in browser it show "RecievingDate is neither a DataColumn nor a DataRelation for table ."
|
|
|
|
|
I have a Products class. But, I cannot define all the properties of that class because my "automobile" client may have one set, while my "baker" client may have another set. The surest way to keep my webite "Product Management" program flexible for all types of businesses with products is to allow them to enter in text fields what their respective product properties are, and of what type (string, integer, etc), and then have that information written to their own "ClientProductProperties.xml"
Where I am lost is how do I get the node names (property names) and attributes (property types) from any client's "ClientProductProperties.xml" and dynamically create their own unique product class properties without having to have a unique Product class for each client/industry ?
|
|
|
|
|
Wow... that's a pretty tall order (no pun intended)
If you are talking about having an xml file define a custom class (a genuine class that gets compiled with your project) then you are looking at developing a custom build provider. I show an example of this in my GridThemes[^] article.
But you may just as well explore storing an xml document for your "client product properties" in an xml-datatype field in your database. As for parsing the XML, there's lots of examples of doing this... either straight with the System.Xml namespace objects, or through LINQ. If you're looking for examples of that nature, they're pretty easy to find through google, but I could probably dig one or two up also. Let me know.
|
|
|
|
|
when i run this program i got an erroe "Exception has been thrown by the target of an invocation."
how to debug it?
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" CellPadding="4"
DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None"
style="z-index: 1; top: 413px; left: 285px; position: absolute; height: 172px; width: 476px; margin-right: 88px"
onrowcancelingedit="GridView1_RowCancelingEdit"
OnRowUpdating="UpdateRecord"
onrowediting="GridView1_RowEditing" PageSize="5">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#E3EAEB" />
<Columns>
<asp:TemplateField HeaderText="Date" HeaderStyle-HorizontalAlign="Left" SortExpression="RecievingDate">
<ItemTemplate >
<asp:Label ID="lbl1" runat ="server" Text ='<%# Bind("[RecievingDate]") %>'></asp:Label> </ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDate" Width="100px" runat="server" Text='<%# Bind("[RecievingDate]") %>'></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Coupon" SortExpression="CouponName">
<EditItemTemplate>
<asp:TextBox ID="txtcoupon" Width="100px" runat="server" Text='<%# Bind("[CouponName]") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblcoupon1" Width="100px" runat="server" Text='<%# Bind("[CouponName]") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Serial Start" SortExpression="Serial_Start">
<EditItemTemplate>
<asp:TextBox ID="txtstart" Width="100px" runat="server" Text='<%# Bind("[Serial_Start]") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblstart1" Width="100px" runat="server" Text='<%# Bind("[Serial_Start]") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="End" SortExpression="Serial_End">
<EditItemTemplate>
<asp:TextBox ID="txtend" Width="100px" runat="server" Text='<%# Bind("[Serial_End]") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblend1" Width="100px" runat="server" Text='<%# Bind("[Serial_End]") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Recieved By" SortExpression="Recieved_By">
<EditItemTemplate>
<asp:TextBox ID="txtby" Width="100px" runat="server" Text='<%# Bind("[Recieved_By]") %>'></asp:TextBox>
</EditItemTemplate>
<ItemTemplate >
<asp:Label ID="lblby1" Width="100px" runat="server" Text='<%# Bind("[Recieved_By]") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Edit" ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" CommandName="Update" Text="Update"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White"
Height="4px" />
<EditRowStyle BackColor="#7C6F57" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
|
|
|
|
|
i have created a datatable containing one column autoincremented true.
i bind this table to gridview with autoincremented column as sno.
now my problem is when user delete one the row in gridview then order of sno number goes wrong.
what is solution of this problem
One person's data is another person's program.
--J.Walia
|
|
|
|
|
You don't need an auto-increment column just to show the serial number. Try the following instead.
<%#Container.DataItemIndex+1 %>
Put the above in a template column.
|
|
|
|
|
thanks for quick reply
you mean there is no need to bind autoincremented column to grid view
One person's data is another person's program.
--J.Walia
|
|
|
|
|
Yes ! Because you can't use Autoincrement no as serial No. Supopose, you have 1,2,3,4,5 ID in table and you delete 4. If you again insert any recored, then new record ID should be 6. Not 5.
So, Do as navaneeth suggested .
|
|
|
|
|
Dear All,
I have two web applications one behind ISA and the other is accessible directly
How can I send the credentials to ISA login page and go directlty to the first web application?
I can connect using HttpWebRequest with the credetials and get the response but when I redirect to the web application I'm asked for the credentials again.
Best Regards
3ala2
|
|
|
|
|
hi all ,
In local host my web site working well.So i publish the website and upload the every file from publish folder to the server through cuteftp.when i run the website then
Server Error in '/' Application.
Runtime Error
shows on my default page........can anybody tell me where is problem.
thanks
|
|
|
|
|
<!--<authentication mode="Windows"/>-->
Line 59:
Line 60: <authentication mode="Forms">
Line 61:
Line 62: <forms defaultUrl="~/PresentationLayer/Forms/Main.aspx" loginUrl="~/Default.aspx" >
problem is here
|
|
|
|
|
Does you virtual directory configured properly on IIS ?
|
|
|
|
|
Have a look at the Event Viewer.
|
|
|
|
|
Hi,
I am trying to implement a site(Read/Update/Delete operations site) using MVP pattern. Also trying to keep the presentation layer UI agnostic(i.e. Presentation layer should work with a Web Client/Windows Client).
Now I have a domain object with around 30 fields/attributes and all of these fields are editable in the UI(View).
I want to propogate the change in any field to the Presentation layer. The only solution I can think of is to define 30 events!!! in the View and 30 handlers in the Presentation layer or define 30 setter methods in the presentation layer for the 30 event handlers in the view.
Am not comfortable with this design.
Can any one provide me a solution or a direction on this?
Regards,
Cybernate
|
|
|
|
|
First, why should the presentation layer work in two different presentation models?
You mean the controller?
I can see this:
Model <shared>
Controller <shared>
View - one instance for web, one instance for web form
That makes more sense to me.
I'm also assuming your changes are to "something" not just random fields, but fields that belong to an object.
So why not maintain the original object state in the controller:
Controller<T> where T: class
T _state;
Have a typed args, something like:
public class TypedArgs<T> : EventArgs where T: class
{
public T Value { get; set; }
}
Create an interface for your views:
public interface IView<T> where T: class
{
event EventHandler<TypedArgs<T>> Changed;
}
then you can raise Changed with the new entity in the view, and have the controller register. Just pass in IView to the controller so it doesn't care if it's a user control or a web form, and when Changed is raised, it can compare e.Value to the stored state and decide what to do.
|
|
|
|
|
Thanks Jeremy.
I tried to provide my question with an example.
I have a scenario where I have to display a view with around 30 fields(some are textboxes and some are Dropdowns) and the Business Object to represent the entity would be something like:
[CODE]
Parent
{
PField1
PField2
.
.
.
.
PField19
PField20
List<Son> Sons;
List<Daughters> Daughters;
}
Son
{
SField1
SField2
SField3
}
Daughter
{
DField1
DField2
DField3
DField4
DField5
}
[/CODE]
Am capturing/displaying the whole business entity in a single view.
Now the user can change the base fields of a parent or change the fields of a son/daughter.
Now how should I handle the change events for each field in the view, should I delegate the change events to the Presenter and then let presenter update the view. This requires to define 22 events in the View and then 22 delegate events in view and 22 event handlers in the presentation layer.
Somehow am not having a good feeling about this design.
Can you please advise?
Regards,
Cybernate
modified on Tuesday, July 28, 2009 4:01 PM
|
|
|
|
|
AFAIK, MVP is not well suited for web-applications. It works well with stand-alone applications. You may try the MVC model. ASP.NET has a MVC framework available. Give it a try.
Cybernate wrote: I want to propogate the change in any field to the Presentation layer. The only solution I can think of is to define 30 events!!! in the View and 30 handlers in the Presentation layer or define 30 setter methods in the presentation layer for the 30 event handlers in the view.
That is ugly. You can have only one method in the presentation layer which takes an aggregate data structure and does the UI binding. Read this[^] MSDN article which takes MVP pattern in detail.
|
|
|
|
|
Thanks for your inputs.
I am not sure if I agree with you on MVP not suited for Web Apps.
Regarding the 30 Events statement I was being sarcastic.
Thanks for trying though.
Regards,
Cybernate
|
|
|
|
|
hi guys...
i want to make a user availability control in a ajax enabled asp.net website
so i placed a textbox & a label(which shows the username exists or not ) inside the updatepanel
i use a button(placed outside updatepanel) as a trigger for asynchronous postback of the updatepanel
all works fine ...but the page is reloaded.....i mean the user have to wait a few seconds for the output...
but i want it asynchronously ...so the total page is not updated...
help me .....
|
|
|
|
|
Make sure that the Updatepanel updatemode is "Conditional" and set your textbox autopostback to "true"
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
i have done this all....
but still the pasge is reloaded....invisible for a little time & then shows the output
|
|
|
|
|
can i see the markup
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|