|
I have change the property to public but still showing error
"DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'IsVisible'."Sasmi
|
|
|
|
|
Modify the gridview code where you set the visible property like this.
Visible='<%# IsVisible %>'
|
|
|
|
|
Yes,
Thanks now it working fine....
can i access any class property using this syntex?
Thank you very muchSasmi
|
|
|
|
|
hi! i've seen that you've solved your problem. but you can use also
<%=Server.HtmlEncode(IsVisible) %> when you use IsVisible function to return a string (parse true to "true" and false to "false")
|
|
|
|
|
Hi,
I am trying to use the Sqlcachedependency in my application but am getting error...
step1) Enabled notification service of the database
step2) enabled notification service of the Table
step3) coding in asp.net2.0
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
DataTable tbl1 = new DataTable();
tbl1 = (DataTable) Cache.Get("tbl");
if (tbl1 == null)
{
tbl1 = fnloadgrid();
lbl.Text = System.DateTime.Now.ToString();
}
grd.DataSource = tbl1.DefaultView;
grd.DataBind();
}
}
public DataTable fnloadgrid()
{
if (Con.State == ConnectionState.Closed)
{
Con.ConnectionString = Constr.ConnectionString;
Con.Open();
Cmd.Connection = Con;
Cmd.CommandType = CommandType.StoredProcedure;
Cmd.CommandText = "Sp_Select";
Cmd.Parameters.Add("@Tabid", SqlDbType.Int).Value = 1;
SqlCacheDependency Depend = new SqlCacheDependency(Cmd);
Da.SelectCommand = Cmd;
Da.Fill(Ds, "tbl");
tbl = Ds.Tables[0];
Cache.Insert("tbl", tbl, Depend);
}
return tbl;
}
note: while filling am getting error like as follows,
Notifications require SQL Server 9.0 or later.
so what is this Error ..can u clear me plz.......?
Regards,
kannak.......kannak
|
|
|
|
|
sekannak wrote: Notifications require SQL Server 9.0 or later
Means that you'll need SQL Server 2005, or newer. Are you running SQL Server 2000 by any chance?I are Troll
|
|
|
|
|
Hi Everyone,
I have hosted my appication in IIS,some of my PDF files are in other system.but before configuring in IIS its working fine.my questionis how to acces PDF files after hosting in IIS. My Path is some thing like this..
\\inlogicpc17\dotnetkanna\test.pdfRegardsKanna
Rgrds
Kanna
|
|
|
|
|
Are the files you are trying to access on another server? If so are they on the same domain?
|
|
|
|
|
Thnks.
Its not in another server.it will be in another machine.for example another machine d:test.pdf ,This machine will be connected as network.
|
|
|
|
|
|
Hey,
does any one know what might clear a session?
i have a session that is automatically cleared when i click on a hyperlink.
i couldn't trace the problem , since no event for a hyperlink.
the hyperlink is only redirecting me to another page.
I didn't clear the session in any of my codes. however it's cleared when i click on the hyperlink.
Thanks for you help.
Rana
|
|
|
|
|
By default session will be automatically cleared after 20 min of unusage.
In your case are you sure you are not assigning new value for the session in the page load?
|
|
|
|
|
Sure i am not.
sometimes it works from the first click(the session is not cleared),
but after the second click it is cleared !!!
|
|
|
|
|
try to put a link button instead of hyperlink and trace
the code to see where the session is being cleared
|
|
|
|
|
badre!!!
I already tried it.
|
|
|
|
|
ya none at least ana bronze
|
|
|
|
|
heheheh
nice one
|
|
|
|
|
Hi,
How to open excisiting excel document in asp.net??Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
You can read excel into a dataset and then can dispay it easily using grid view of whatever control you prefer.
int workSheetNumber = 0;
OleDbConnection ExcelConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FilePathWithName + ";Extended Properties=Excel 8.0;");
OleDbCommand ExcelCommand = new OleDbCommand();
ExcelCommand.Connection = ExcelConnection;
OleDbDataAdapter ExcelAdapter = new OleDbDataAdapter(ExcelCommand);
ExcelConnection.Open();
System.Data.DataTable ExcelSheets = ExcelConnection.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
string SpreadSheetName = "[" + ExcelSheets.Rows[workSheetNumber]["TABLE_NAME"].ToString() + "]";
DataSet ExcelDataSet = new DataSet();
ExcelCommand.CommandText = @"SELECT * FROM " + SpreadSheetName;
ExcelAdapter.Fill(ExcelDataSet);
|
|
|
|
|
Hello,
Please help i want to add update and delte data from the specified table.I m using Gridview and i want to to add data in grid when add button is clicked and also edit it on edit button. It same as we do in windows app (i.e., is add data in specify cells and click on save button to save the data in table.)Please help its urgent?
|
|
|
|
|
|
Its not so hard but i want add Data in Gridview Selected Cell and Save its contains in Table as we do using fp spread for some other 3 party components?
|
|
|
|
|
Hello,
I need help, i want to list a content from specific folder from FTP, a can make the connection to FTP, but i don't know how can list the files contended in a specific Folder from FTP in one ListBox.
Thank's for you time, i'm new ( beginner) in .NET
Thank's again !
This is my code in C#
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FtpWebRequest Request = (FtpWebRequest)WebRequest.Create("ftp://server.com");
Request.Method = WebRequestMethods.Ftp.ListDirectory;
Request.Credentials = new NetworkCredential("user", "pass");
FtpWebResponse Response = (FtpWebResponse)Request.GetResponse();
Stream ResponseStream = Response.GetResponseStream();
StreamReader Reader = new StreamReader(ResponseStream);
//ListBox1.Items.Add(Response.BannerMessage);
//ListBox1.Items.Add(Response.WelcomeMessage);
while (!Reader.EndOfStream)//Read file name
{
ListBox1.Items.Add(Reader.ReadLine().ToString());
}
Response.Close();
ResponseStream.Close();
Reader.Close();
}
}
and i have one folder ftp;//server.com/FolderX/
i want to list the files from FolderX in one ListBox and in one label to show me the numbers of files from FolderX
Many thamks
|
|
|
|
|
hi
actualy i want to create dynamic menu accroding to permission of user.
it should get generate dynamically.....
for that i used database...there are three tables related to menus
1. tblModule -which contains module code and module description i.e. masters,search,rate entry
2. tblMenu- which contains menucode,menu desc.(bus,car,flight,train),modulecode.
3. tblSubMenu-which contains submenucode,submenuname(add new bus,del bus,modify bus,search bus,add new rate entry
for bus ...etc),submenulinks(means path of aspx file i.e. Masters/bus/newBusEntery.aspx),menucode
now i want to dynamically create menus according to permissions like bus|car|flight...
after clicking on bus it should display the submenu in dropdown manner like this,
-add new bus
-modify bus
-delete bus
and after selecting add new bus it should display the 'newBusEntery.aspx' page which is in Masters/bus folder
whose path is stored in tblSubMenu table..
please, give code samples i need it urgently and i am new in asp.net,so help me friends....
thanx..
|
|
|
|
|
Hi to all forum members.
I am stuck in implementing ModalPopupExtender in <asp:CommandField in grid view.
Although below code is working fine in <asp:template field in grid view.
<asp:TemplateField HeaderText="Delete" HeaderStyle-CssClass="tableheading" HeaderStyle-Width="70px">
<ItemTemplate>
<center>
<asp:ImageButton ID="imgDelete" runat="server" OnClientClick="showConfirm(this); return false;"
ImageUrl="~/Images/delete.png" OnClick="imgBtnDelete_Click" /></center>
</ItemTemplate>
</asp:TemplateField>
following is my code which I am trying to implement in <asp:CommandFiel in grid view.
.aspx code
Grid view code
<asp:CommandField HeaderText="Edit/Delete" ItemStyle-HorizontalAlign="Center" CausesValidation="false"
ShowCancelButton="true" ShowEditButton="True" ShowDeleteButton="true" />
modal popup code
<ajaxToolkit:ModalPopupExtender ID="md1" runat="server" BackgroundCssClass="modalBackground"
BehaviorID="mdlPopup" CancelControlID="btnNo" OkControlID="btnOk" OnCancelScript="cancelClick();"
OnOkScript="okClick();" PopupControlID="Confiramtiondiv" TargetControlID="Confiramtiondiv">
</ajaxToolkit:ModalPopupExtender>
<div id="Confiramtiondiv" runat="server" align="center" style="display: none">
<table id="Table3" cellpadding="1" cellspacing="1" border="0" bordercolor="blue"
runat="server" align="center">
<tr>
<td colspan="4" align="center">
<asp:Label ID="lblConfirmmsg" runat="server" Text="Are you sure you want to delete this Trip ?"
CssClass="lblConfirmmsg"></asp:Label>
</td>
</tr>
<tr>
<td width="20%">
</td>
<td width="30%">
<asp:Button ID="btnOk" runat="server" Text="Yes" CausesValidation="false" Width="50px" />
</td>
<td width="30%">
<asp:Button ID="btnNo" runat="server" CausesValidation="false" Text="No" Width="50px" />
</td>
<td width="20%">
</td>
</tr>
</table>
</div>
.cs code
protected void grdTrips_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowState != DataControlRowState.Edit) // check for RowState
{
if (e.Row.RowType == DataControlRowType.DataRow) //check for RowType
{
string id = e.Row.Cells[0].Text; // Get the id to be deleted
LinkButton lb = (LinkButton)e.Row.Cells[8].Controls[2]; //cast the ShowDeleteButton link to linkbutton
if (lb != null && lb.Text == "Delete")
{
lb.Attributes.Add("onclick", "showConfirm(this); return false;"); //implementing Ajax modal popup extender
}
}
}
Java Script Function
// keeps track of the delete button for the row
// that is going to be removed
var _source;
// keep track of the popup Confiramtiondiv
var _popup;
function showConfirm(source){
this._source = source;
this._popup = $find('mdlPopup');
// find the confirm ModalPopup and show it
this._popup.show();
}
function okClick(){
// find the confirm ModalPopup and hide it
this._popup.hide();
// use the cached button as the postback source
__doPostBack(this._source.name, '');
}
function cancelClick(){
// find the confirm ModalPopup and hide it
this._popup.hide();
// clear the event source
this._source = null;
this._popup = null;
}
This code opens modal popup but its does not goes to RowDeleting Event of gridview
.
When I changed this code
lb.Attributes.Add("onclick", "showConfirm(this); return false;");
to
lb.Attributes.Add("onclick", "showConfirm(this);");
it open the modal popup but then directly goes to to grid view RowDeleting Event of gridview with out asking confirmation from the users.
I again told this code is working fine in <asp:templatefield.
Welcome for your valuable suggestionsVishnu Narayan Mishra
Software Engineer
|
|
|
|