|
Please check your code properly.I think your form is not submitted properly or the newvalue is not assigned.You can check it by using javascript that the variable value changeed before submiitng the form or not for verification.
Cheers!!
Brij
|
|
|
|
|
I have a site that is accessing a database housed on the local machine. The database has linked tables that are linked to files on a server. When I add a gridview that dispalys results associated to those linked files on the server I get the following error message:
'Y:\Macros\WFAC' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.'
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.Data.OleDb.OleDbException: 'Y:\Macros\WFAC' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
I am using VS 2008 to build the site and when I test it in VS2008 it works fine, but when I try to pull it up outside of VS I get this error. I verified the path is right, but there is some issue reading the linked file "'Y:\Macros\WFAC' " this is within the DB that is on the local machine and not part of the acutal asp.net code?
Does anyone know how I can clear this error?
|
|
|
|
|
"Y:\Macros\WFAC" I dont think this is name of any file. it seems to be path to a folder. if WFAC is name of the file then give its extension.
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
"Y:\Macros\WFAC" is the foler where a spreadsheet is housed. This spreadsheet is link to my database. I am trying to display a query in gridview from this database but it is giving the above error. I am not trying to access anything in "Y:\Macros\WFAC" directly from the webpage, but still get the error message. The database is on my local machine and "Y:\Macros\WFAC" is a remote server.
|
|
|
|
|
Hi,
How to raise Session_End event at Global.asax if I use SQLServer for session state. I want to clean up some data when user click X at their browser or if their session is expired.
Any help will be appreciate.
Thanks
|
|
|
|
|
mdpavel wrote: I want to clean up some data when user click X at their browser
Then you need to use the Javascript onunload event and make a request to the server telling it that the user is leaving the page. You can't use session state to catch when the user is leaving, as the server session doesn't end when the browser is closed.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Using a custom ExpressionBuilder doesnt seem to work with ParseControl (dynamically adding controls, that are using the custom ExpressionBuilder)
Works fine with the build-in Resources ExpressionBuilder though.
Anyone have a solution/workaround for this?
Or even an explanation for why it doesnt work.
Example
protected void Page_Load(object sender, EventArgs e) {
string s = (@"
<hr />
1: <asp:Label ID=""Label1"" Text=""<%$ Resources:language, Greeting %>"" runat=""server"" />
<br />
2: <asp:Label ID=""Label2"" Text=""<%$ IHLPResource:Greeting %>"" runat=""server"" />
<hr />
");
Control ctrl = ParseControl(s);
Page.Form.Controls.Add(ctrl);
}
1: Gets rendered just fine, while 2: fails (no error, the value just doesnt get rendered)
ie. the output is:
1: Hi
2:
(2: should say "\\\Output from custom ExpressionBuilder///" - See code below)
If I simply add the above to the aspx page, it works fine (ie. my custom ExpressionBuilder is not the cause of failure)
--------------------------------------------------------------------------------------------
CODE - For quick copy/paste to test yourself
--------------------------------------------------------------------------------------------
DynTest.aspx
<%@ Page Language="C#" AutoEventWireup="true" Codebehind="DynTest.aspx.cs"
Inherits="IHLP2007PoC.DynTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>WelcomeLabel Test</title>
</head>
<body>
<form id="form1" runat="server">
<hr />
1: <asp:Label ID="Label1" Text="<%$ Resources:language, Greeting %>" runat="server" />
<br />
2: <asp:Label ID="Label2" Text="<%$ IHLPResource:Greeting %>" runat="server" />
<hr />
</form>
</body>
</html>
DynTest.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
namespace IHLP2007PoC {
public partial class DynTest : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
string s = (@"
<hr />
1: <asp:Label ID=""Label1"" Text=""<%$ Resources:language, Greeting %>"" runat=""server"" />
<br />
2: <asp:Label ID=""Label2"" Text=""<%$ IHLPResource:Greeting %>"" runat=""server"" />
<hr />
");
Control ctrl = ParseControl(s);
Page.Form.Controls.Add(ctrl);
}
}
}
IHLPResourceExpressionBuilder.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.CodeDom;
using System.ComponentModel;
using System.Web.Compilation;
namespace IHLP2007PoC.Code {
public class IHLPResourceExpressionBuilder : ExpressionBuilder {
public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object
parsedData, ExpressionBuilderContext context) {
string evaluationMethod = "GetResourceString";
CodeTypeReferenceExpression thisType = new CodeTypeReferenceExpression(base.GetType());
CodePrimitiveExpression expression =
new CodePrimitiveExpression(entry.Expression.Trim().ToString());
return new CodeMethodInvokeExpression(thisType, evaluationMethod, new CodeExpression[] { expression });
}
public static string GetResourceString(string key) {
return @"\\\Output from custom ExpressionBuilder///";
}
}
}
Web.config
<?xml version="1.0"?>
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<compilation debug="true" >
<expressionBuilders>
<add expressionPrefix="IHLPResource" type="IHLP2007PoC.Code.IHLPResourceExpressionBuilder"/>
</expressionBuilders>
</compilation>
<authentication mode="Windows" />
<pages />
<globalization uiCulture="da" culture="da-DK" />
</system.web>
</configuration>
Expected output
--------------------------------------------------------------------------------
1: Hi
2: \\\Output from custom ExpressionBuilder--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
1: Hi
2: \\\Output from custom ExpressionBuilder
Actual output
--------------------------------------------------------------------------------
1: Hi
2: \\\Output from custom ExpressionBuilder--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
1: Hi
2:
modified on Thursday, October 23, 2008 11:42 AM
|
|
|
|
|
Come now CP... No takers at all?
|
|
|
|
|
Hi
when I click on lnkAddTraveller link it always needs 2 times click on this link to execute lnkAddTraveller_Command event block.
How can I solve this problem.
lnkAddTraveler.Command += new CommandEventHandler(lnkAddTraveller_Command);
lnkAddTraveler.CommandName = "Hotel," + dtHotelInfo.Rows[i]["Id"].ToString() + "," + dtHotelInfo.Rows[i]["HotelID"].ToString();
private void lnkAddTraveller_Command(object sender, CommandEventArgs e)
{
//Code here
}
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
Hi,
I have a javascript code for pop window. I want to pass values from this calling page to that pop window and similarly i want to send some data from that window to this called page.
Plz Help me.....
Thanks in advance!
Lakshmi
|
|
|
|
|
you can access a value in Poppup window using Parent page(using window.opener).
Cheers!!
Brij
|
|
|
|
|
blakshmi wrote: I want to pass values from this calling page to that pop window
just send as normal query string
window.open("mypage.aspx?querystring...");
blakshmi wrote: similarly i want to send some data from that window to this called page.
Use Window.opener or window.parent
cheers,
Abhijit
|
|
|
|
|
Can it is possible to fetch Client Mechine IP under Run Prosxy Server(Internet Distributive Envoirnment).I have written code
string IPAddress = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();
but it was return Proxy Server IP,but my moto to find out both proxy ip & Client IP.It is possible My Proxy server retrun Client Mechine IP.
Plz help me.
|
|
|
|
|
Probably not - your request has come from the proxy server...
|
|
|
|
|
I want to show all the dates of the current week on the page_load event .How can i do this.
Can any one help me.
Regards
|
|
|
|
|
This will give you all the dates in the current week - you will need to adfjust it depending on what your starting day is, this assumes Monday.
DateTime curr;
DateTime start = DateTime.Now.AddDays((int)DateTime.Now.DayOfWeek * -1);
for (int c = 1; c < 8; c++)
{
curr = start.AddDays(c);
}
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Great !!! a Small correction
insted of using
Ashfield wrote: curr = start.AddDays(c);
use
curr =start.AddDays(c).ToShortDateString();
5 from me
cheers,
Abhijit
|
|
|
|
|
Pleased to be of help.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello,
I am developping a web application in which i need to retrieve attachments from inbox mails.
I am able to connect to exchange server (gmail) and also able to fetch inbox.
But not getting any idea to retrive the the attachment to my .aspx page.
So please help me.
Thanks in adavance.
|
|
|
|
|
Do you have GMAIL Api's for accessing GMAIL mail? you need those api .
cheers,
Abhijit
|
|
|
|
|
Hello Avijeet.
Actualy i am trying to connect to any exchange server.
For example i want to connect to my company webmail.
And to fetch attachments from my inbox mails.
Do u have any sugestion....
thank for answering me.
|
|
|
|
|
subrat4all wrote: Actualy i am trying to connect to any exchange server.
To which exchange server do you want to connect? Exchage server 2003 or 2007.
if your are trying to access Exchange 2007 Server, then you can able to do it easily. becuase Exchange 2007 provide Webservices for same (EWS ) . But its not possible using Exchange 2003, because it does not provide any such API's
Check This[^]
cheers,
Abhijit
|
|
|
|
|
well abhi .....
I want to retrieve the attachment... not to sendmail with attachment.........
So plz share your view.........
|
|
|
|
|
In which form Information passed from one ASP.NET page to another.
|
|
|
|
|
There are many ways to pass information from one page to another page like Querystring,session etc.
What do u exactly want to know?
|
|
|
|