|
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
|
|
|
|
|
hi,
i have useing asp.net 2.0 and ajax extension.
i have pass 3 value to popup window...if update some values in child(popup) window. its automatically refresh particular (update panel or) gridview in parent page.
i have code for refresh parent window. but i dont have code for refresh particular window.Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
are you using that popup from same page or open popup from another page?
|
|
|
|
|
(New) another page Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
|
|
|
|
|
Dear all,
I was doing a calculation on the total of costs using datagrid. There are only two row in my data. I use the following to insert the summary to the footer but is not success which is as below:
For RawCount = 0 To ItemCount - 1
Quantity(RawCount) = Me.dtGrid.Items(RawCount).Cells(2).Text
Price(RawCount) = Me.dtGrid.Items(RawCount).Cells(5).Text
Costs(RawCount) = Quantity(RawCount) * Price(RawCount)
Me.dtGrid.Items(RawCount).Cells(6).Text = Costs(RawCount)
TotalQuantity = Quantity(RawCount) + TotalQuantity
TotalCost = TotalCost + Costs(RawCount)
If Me.dtGrid.Items(RawCount).ItemType = ListItemType.Footer Then
Me.dtGrid.Items(RawCount).Cells(2).Text = TotalQuantity
End If
Could anyone please help me check what is the problem and why the data is not display in my footer raw?
Thank you so much for the help!
|
|
|
|
|
Please refer from Here[^]
|
|
|
|
|
Hi all,
Use the google graph API if you need any graph requirement in your application, its really good
See the example:
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["piechart"]});
google.setOnLoadCallback(drawPieChart);
// google.load("visualization", "1", {packages:["barchart"]});
// google.setOnLoadCallback(drawBarChart);
function drawBarChart() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Sales');
data.addColumn('number', 'Expenses');
data.addColumn('number', 'Expenses1');
data.addColumn('number', 'Expenses2');
data.addColumn('number', 'Expenses3');
data.addColumn('number', 'Expenses4');
data.addColumn('number', 'Expenses5');
data.addColumn('number', 'Expenses6');
data.addColumn('number', 'Expenses7');
data.addColumn('number', 'Expenses8');
data.addColumn('number', 'Expenses9');
data.addRows(1);
data.setValue(0, 0, '');
data.setValue(0, 1, 1000);
data.setValue(0, 2, 400);
data.setValue(0, 3, 700);
data.setValue(0, 4, 40);
data.setValue(0, 5, 90);
data.setValue(0, 6, 480);
data.setValue(0, 7, 120);
data.setValue(0, 8, 100);
data.setValue(0, 9, 400);
data.setValue(0, 10, 200);
data.setValue(0, 11, 100);
new google.visualization.BarChart(document.getElementById('chart_div')).
draw(data, {width: 600, height: 440, is3D: true});
}
function drawPieChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Expense Item');
data.addColumn('number', 'Expense');
data.addRows(8);
data.setValue(0, 0, 'Food');
data.setValue(0, 1, 11);
data.setValue(1, 0, 'Drinks');
data.setValue(1, 1, 2);
data.setValue(2, 0, 'Cinima');
data.setValue(2, 1, 2);
data.setValue(3, 0, 'party');
data.setValue(3, 1, 2);
data.setValue(4, 0, 'smoke');
data.setValue(4, 1, 7);
data.setValue(5, 0, 'smoke2');
data.setValue(5, 1, 7);
data.setValue(6, 0, 'smoke3');
data.setValue(6, 1, 7);
new google.visualization.PieChart(document.getElementById('chart_div')).
draw(data,{width: 600, height: 440, is3D: true});
}
</script>
</head>
<body>
<div id="chart_div"></div>
</body>
</html>dhdh
|
|
|
|
|
Hey its nice. thank you. But can you give any URL for this. Naina
|
|
|
|
|