|
yes I know this but I want to maintain it through globle files
|
|
|
|
|
onfiguration Error
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.
Parser Error Message: Access is denied: 'Microsoft.Practices.EnterpriseLibrary.Data'.
Source Error:
Line 196: <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
Line 197: <add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
Line 198: <add assembly="*">
Line 199:
Line 200:
Source File: c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config Line: 198
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Practices.EnterpriseLibrary.Data' could not be loaded.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Data
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/AutoSys/Procurements/Web
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Microsoft.Practices.EnterpriseLibrary.Data
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/autosys_procurements_web/14145ce2/887b2a67/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Attempting download of new URL file:///C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/autosys_procurements_web/14145ce2/887b2a67/Microsoft.Practices.EnterpriseLibrary.Data/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/AutoSys/Procurements/Web/bin/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Microsoft.Practices.EnterpriseLibrary.Data, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null
This error is accuring most commonly.....Any solutions to rectify it?
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
HimaBindu Vejella wrote: Any solutions to rectify it?
You simply copy the assembly Microsoft.Practices.EnterpriseLibrary.Data.dll to the temp folder of your web application:
C:/WINNT/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/autosys_procurements_web/14145ce2/887b2a67/
|
|
|
|
|
Hi all,
How to bind the records from sql server tables and display into the HTML table control.
The data should be displayed in the HTML table with all features of datagrid(paging,edit and delete and go to page No).Simply with out using the datagrid.
Pls suggest me with some sample codings.
Thakx
Paul
Paul
|
|
|
|
|
Hi Paul,
The html table control does not support data binding like a data-bound control such as datagrid, datalist ..., so if you want to use the html table, you need to walk through the record collection of the datasource, then build each row (tr) for the table. Also you also need to manage all the built-in features of the datagrid control like paging, sorting ....it seems overhead to you. So I'm curious that why you don't just use the datagrid control.
|
|
|
|
|
Thnak you for your suggession.
But I am trying to do the datagrid functionalty to the html table.
THanks you again
By
Paul
Paul
|
|
|
|
|
Y don't u use DataGrid/List?
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
I am tring the code to develop without datagrid/list?
Is it possible to do the same using HTMl Controls??
Paul
|
|
|
|
|
Hi..
I have a DataList that includes in its ItemTemplate an ImageButton which should use FieldNO(a DataItem field in the datasource ) as a QueryString to redirect() to another page:
Response.Redirect("default.aspx?FieldNO="+fieldNO+"&ProjectNO="+projectNO);
But i want this to happen only in a specific situation
(if(searchString!=null) is true) So the DataBinder.Eval() alone wont do what i want.So i used the following code in the method assigned to the OnCommand ImageButton attribute:
string fieldNO;
string argu=e.CommandArgument.ToString();
string[] argss=argu.Split(',');
if(searchString!=null)
{
DataRowView drv=(DataRowView)lProjects.Items[Convert.ToInt32(argss[1])].DataItem;
fieldNO=Convert.ToString(drv["FieldNO"]);
}
Where lProjects is the DataList And the Command Argument of the ImageButton is:
CommandArgument='<%#DataBinder.Eval(Container.DataItem,"ProjectNO")+","+Container.ItemIndex%>'
There is no relation between "ProjectNO" and the problem.The problem exists with the other field "FieldNO"
which i should get it from the datasource of the DataList in a specific condition.
But this code give me the error :
Object reference is not set to an instance.
Sorry if i couldnt explain my problem.
Could any one help?
|
|
|
|
|
+ You can use the ?: operator in the data binding expression to check if you should call the Eval method to populate the command argument.
+ You can wrap your sample code in a method, then simply call it in the data binding expression.
You can see the sample code from here[^].
|
|
|
|
|
These two ideas are exactly what i need.
May you give me code examples for them?...
|
|
|
|
|
You can find the examples from the provided link, and you can easily reuse it for your purpose:
+ Option 1:
<%# (strSearch is not null)? DataBinder.Eval(...):"" %>
+ Option 2:
<%# GetCommandArgument(Container.DataItem) %>
...
you can also define this method in the inline code.
Note: They all are the pseudo code.
|
|
|
|
|
Sorry,i didnt see the last statement in your previous message which was:
"You can see the sample code from here[^]."
Every thing is clear for me now.
Thank you very very much..I wont forget your help.
|
|
|
|
|
TheEagle wrote: Every thing is clear for me now.
Glad to hear you figured it out , good luck to you !
|
|
|
|
|
Hi..
after i build the code in my UserControl it gives me the error:
D:\MyWebApps\EProjects\UserControls\FieldProjectsList.ascx.cs(133): The type or namespace name 'DataBinder' could not be found (are you missing a using directive or an assembly reference?)
It seems to me that the UserControl is different from the WebForm in using the DataBinder class in the code behind page.
Could you help me in this problem?
|
|
|
|
|
Do you include the System.Web.UI namespace in the code-behind of the web user control?:
using System.Web.UI; In case you cannot figure out the problem, you might want to post your sample code in the user control.
|
|
|
|
|
Hi..Sorry for being too late.
After i added:
using System.Web.UI;
The build error disappeared but after i uploaded(updated) the project i got the error message:
Specified cast is not valid.
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.InvalidCastException: Specified cast is not valid.
Source Error:
Line 12: <TR>
Line 13: <TD vAlign="middle" align="center">
Line 14: <asp:ImageButton id=ImageButton1 runat="server" OnCommand="gogof" ImageUrl='<%#"~/Epictures/"+DataBinder.Eval(Container.DataItem,"ProjectImage")%>' CommandArgument='<%#GenerateDataBinders(Container.DataItem,Container.ItemIndex)%>' CommandName="topf" BorderStyle="Solid" BorderColor="green">
Line 15: </asp:ImageButton></TD>
Line 16: </TR>
Source File: C:\Sites\Single25\nabeel1eagle\webroot\UserControls\FieldProjectsList.ascx Line: 14
The UserControl code:
namespace EProjects.UserControls
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
/// <summary>
/// Summary description for FieldProjectsList.
/// </summary>
public class FieldProjectsList : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.DataList lProjects;
private void Page_Load(object sender, System.EventArgs e)
{
string searchString=Request.QueryString["SearchString"];
string allWords=Request.QueryString["AllWords"];
string pageNumber=Request.QueryString["PageNumber"];
if(searchString!=null && searchString!="")
{
allWords=Request.QueryString["AllWords"];
pageNumber=Request.QueryString["PageNumber"];
lProjects.DataSource=catalog.SearchProject(searchString,allWords,pageNumber,System.Threading.Thread.CurrentThread.CurrentCulture.Name);
lProjects.DataBind();
}
else
{
BindData();
}
}
#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.lProjects.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.lProjects_ItemDataBound);
this.lProjects.SelectedIndexChanged += new System.EventHandler(this.lProjects_SelectedIndexChanged);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
public void gogof(object s,CommandEventArgs e)
{string searchString=Request.QueryString["SearchString"];
// string allWords=Request.QueryString["AllWords"];
/* if(searchString!=null)
{
lProjects.DataSource=catalog.SearchProject(searchString,allWords);
lProjects.DataBind();
}
else
BindData();*/
//string fieldNO=Request.QueryString["FieldNO"];
string fieldNO=Request.QueryString["FieldNO"];
string fieldIndex=Request.QueryString["FieldIndex"];
string allWords=Request.QueryString["AllWords"];
string pageNumber=Request.QueryString["PageNumber"];
//string allWords=Request.QueryString["AllWords"];
/* if(searchString!=null)
{
lProjects.DataSource=catalog.SearchProject(searchString,allWords,pageNumber,System.Threading.Thread.CurrentThread.CurrentCulture.Name);
lProjects.DataBind();
}
else
BindData();*/
string argu=e.CommandArgument.ToString();
string[] argss=argu.Split(',');
string projectNO;
string projectIndex;
if(e.CommandName=="topf")
{
// Trace.Warn("ProjectProblem",projectNO);
if(searchString!=null && searchString!="")
{
Trace.Warn("FieldProblem",argu);
projectNO=argss[0];
fieldNO=argss[1];
Response.Redirect("default.aspx?FieldNO="+fieldNO+"&ProjectNO="+projectNO);
}
else
{
//Trace.Warn("ProjectNO=",Convert.ToString(argu.IndexOf("+")+1));
// Trace.Warn("IndexProblem=",Convert.ToString(argu.IndexOf("_")));
fieldNO=Request.QueryString["FieldNO"];
fieldIndex=Request.QueryString["FieldIndex"];
projectIndex=argss[1];
projectNO=argss[0];
Response.Redirect("default.aspx?FieldNO="+fieldNO+"&FieldIndex="+fieldIndex+"&ProjectNO="+projectNO+"&ProjectIndex="+projectIndex);
}
}
}
public void BindData()
{
string fieldNO=Request.QueryString["FieldNO"];
lProjects.DataSource=EProjects.AdministratorSite.AdminCatalog.GetFieldProjects(fieldNO,System.Threading.Thread.CurrentThread.CurrentCulture.Name);
lProjects.DataBind();
}
private void lProjects_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e)
{
}
private void lProjects_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
public string GenerateDataBinders(object dataItem,int Index)
{string searchString=Request.QueryString["SearchString"];
string projectIndex;
string projectNO;
string fieldNO;
if(searchString!=null && searchString!="")
{
projectNO=(string)DataBinder.Eval(dataItem,"ProjectNO");
fieldNO=(string)DataBinder.Eval(dataItem,"FieldNO");
return projectNO+","+fieldNO;
}
else
{
Trace.Warn("PProjectNO=",Convert.ToString(Index));
projectNO=(string)DataBinder.Eval(dataItem,"ProjectNO");
projectIndex=Convert.ToString(Index);
return projectNO+","+projectIndex;
}
}
}
}
its HTML :
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="FieldProjectsList.ascx.cs" Inherits="EProjects.UserControls.FieldProjectsList" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<asp:datalist id="lProjects" Width="100%" RepeatColumns="2" runat="server">
<ItemTemplate>
<TABLE height="100%" cellPadding="0" width="100%">
<TR>
<TD align="center">
<asp:Label id="Label1" NAME="Label1" Runat="server" CssClass="labelstyle">
<%#DataBinder.Eval(Container.DataItem,"ProjectName")%>
</asp:Label><BR>
</TD>
</TR>
<TR>
<TD vAlign="middle" align="center">
<asp:ImageButton id=ImageButton1 runat="server" OnCommand="gogof" ImageUrl='<%#"~/Epictures/"+DataBinder.Eval(Container.DataItem,"ProjectImage")%>' CommandArgument='<%#GenerateDataBinders(Container.DataItem,Container.ItemIndex)%>' CommandName="topf" BorderStyle="Solid" BorderColor="green">
</asp:ImageButton></TD>
</TR>
<TR>
<TD align="center">
<asp:Label id="Label2" NAME="Label2" Runat="server">
<%#DataBinder.Eval(Container.DataItem,"ProjectDescription")%>
</asp:Label><BR>
</TD>
</TR>
</TABLE>
</ItemTemplate>
</asp:datalist>
I think that the problem in using the Container.ItemIndex.I have made it (int) and beforethis i tried making it object but the same error appeared.
You have helped me all the time thank you very much my teacher.
|
|
|
|
|
Hi..
May you help me in the problem that i mentioned in the previous message?
I couldnt determine what cause that error message..
Any advice could be helpful.
|
|
|
|
|
thanks in advance to all,i got a login from in my application.so i have to textboxes fro user name and password.i have required field validation control for both the text boxes.i have set control to validate and every thing that's working fine.so i got a button control to submit the information of the textboxes.when im clicking the button that validation working fine.my problem is i got another one link button in that page if i click that,that time also my validation controls get called and check for the data in the textboxes.i want to stop this .please help me.
with regards,
susa
|
|
|
|
|
+ If you are using the ASP.NET 2.0, you should check out the ValidationGroup[^] feature.
+ If you are using the ASP.NEt 1.x, you may think of implementing your own validator.
|
|
|
|
|
im using asp.net 1.x and im not having my own validation control and im using asp.net required field validators.
with regards,
susa
|
|
|
|
|
Set CausesValidation Property of the LinkButton to False
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
hi thank u hima it's working now
hi to all
with regards,
susa
|
|
|
|
|
I have a delivery page (binded to an Orders.mdf) that looks something like this. A simple webform that only handle ONE KIND of product but has various weights.
[lblDate] = shows the date selected, receive user selected date from the Calendar control.
[txtDeliveryOrderNo] = clerk types in a Delivery Order No.
[ddlPort] = dropdownlist showing a list of sea port where goods are imported, databound to a SQL ports.mdf
[ddlCustomer] = dropdownlist showing a list of customer, by name. Place where goods are delivered. Databound to a SQL customers.mdf
[ddlTruck] = dropdownlist showing which truck does the delivery
[txtGrossWeight] = user enter the gross weight of the item here and then click on an "ADD ITEM" button control to store record. Can have multiple items.
[btnSave] = saves the order record to the orders.mdf.
[btnCancel] = cancel the order record.
Is there anyone who can gimme a rough idea of how this could be done? Or has anyone done it before? I need it in C# codes.
|
|
|
|
|