|
I am developing a website(File system), in that I am using a grid view control. In the code behind file, I am using gridview control's rowDeleting event. When the user clicks delete button , I am displaying a messagebox asking whether to delete or not. When I am running from source it works fine.
But after publishing my website, from the published pages, when I click the delete button, I am getting the following error.
"showing a model dialog box or form when the application is not running in user interactive mode is not a valid operation. Specify the serviceNotification or DefaultDesktopOnly Style to display a notification from a service application."
How can I resolve this problem?
thank u all,
kiran
|
|
|
|
|
Hi Kiran,
What is the purpose of displaying this messagebox?
Please remember that your code is running on a server and how will this code interact with your user's dekstop.
Instead of doing this way, I would suggest you to please use client side javascripting.
]
Best Regards,
Sam Xavier
www.componentone.com
|
|
|
|
|
Hi All,
I am using monthname() function for particular boundfield for a gridview in ASP.NET2.0.
When I display it It shows "system.byte[]" in the cell instead of particular Month name.
I am using MySQL database and the command is
"SELECT MONTHNAME(sales.issuedate) AS 'Month', Count(Month (date(sales.issuedate))) AS 'Sale' From sales Group by Month(date(sales.issuedate))"
I look for the solution on the NET but no luck.
Please help me out.
good day
|
|
|
|
|
which method u r using to retrieve value from database. like executenonquery etc..
Better if u can paste the code here.
|
|
|
|
|
Hi,
I used sqldatasource. The following is the command.
<asp:sqldatasource id="SqlDataSource1" runat="server"
="" connectionstring="<%$ ConnectionStrings:testConnectionString %>" providername="<%$ ConnectionStrings:testConnectionString.ProviderName %>" selectcommand="SELECT MONTHNAME(sales.issuedate) AS 'Month', Count(Month (date(sales.issuedate))) AS 'Sale' From sales Group by Month(date(sales.issuedate))">
I hope this is the ans for your question.
|
|
|
|
|
where are u storing result of the query.... and In which line u r gettin error..
|
|
|
|
|
Hi G,
I am displaying the data in a boundfield of a GridView. There is no error. It works fine. But It just does not showing the right format of the result. The result should be the name of the months.
But It is showing "System.Byte[]" instead.
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False"><br />
<Columns><br />
<asp:BoundField DataField="Month" HeaderText="Month" SortExpression="Month" /><br />
<asp:BoundField DataField="Sale" HeaderText="Sale" SortExpression="Sale" /><br />
</Columns><br />
</asp:GridView>
The result
---------------------------------¬
Months ¦ Number of Sales ¦
--------------¦------------------¦
System.Byte[] ¦ 11 ¦
--------------¦------------------¦
System.Byte[] ¦ 37 ¦
----------------------------------
-- modified at 5:49 Wednesday 28th November, 2007
|
|
|
|
|
Thats wot I want to know wot value u r assigning to Months column.
|
|
|
|
|
I assign the return data from sql statement which is string (because when I extract MONTHNAME from date it would return a string).
So there should not be System.Byte[] in the cell of the gridview.
|
|
|
|
|
Hi to All,
I am trying to handle excel file in my application. Here I am trying to get a cell value in the text box on the event of button click. but whenever i run it shows exception that Access is denied..... my code is as follows....
private Excel.Application oXL=null;
private void Button1_Click(object sender, System.EventArgs e)
{
InitializeComponent();
oXL = new Excel.ApplicationClass();
oXL.Visible = true;
Excel.Workbook oWB = oXL.Workbooks.Open("D:\\Pravin\\October-07\\xls\\7starcare-October.xls",0,true,5,"","",true,Excel.XlPlatform.xlWindows,"\t",false, false, 0, true);
Excel.Sheets oSheet= oWB.Worksheets;
Excel.Worksheet oWS = (Excel.Worksheet)oSheet.get_Item(1);
TextBox1.Text= Convert.ToString(oWS.Cells.get_Item(1,1));
}
But whenever i run my application it shows exception as follws ....
------------------------------------------------------------------------------------------------
Access is denied.
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.UnauthorizedAccessException: Access is denied.
ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
----------------------------------------------------------------------------------------------------
how can i remove this problem?
Pravin
|
|
|
|
|
Add another node in ur config file with identity impersonation ="true"
|
|
|
|
|
<identity impersonation ="true"/>
|
|
|
|
|
Hi all,
i want session variables set in an asp page onto my ASP.NET page. IS it possible?
I have heared that it can be done by using hidden fields given in this article
http://www.eggheadcafe.com/articles/20021207.asp[^]
but i m using a menubar for navigation and hence i am not submitting any forms.
Is there any alternative..
|
|
|
|
|
You can share session between asp and asp.net. Check this[^] to get more information on it.
Apurva Kaushal
|
|
|
|
|
Hi all,
i m sending mails using Asp.net 2.0
Here is my code
Sub SendMail()
Dim msg As New MailMessage()
Dim attach_file1 As String = String.Empty
Dim strfilename As String = String.Empty
Dim strpath As String = Request.ApplicationPath & "/" & "Attachments" & "/"
strfilename = Path.GetFileName(UploadCV.PostedFile.FileName)
UploadCV.PostedFile.SaveAs(Server.MapPath(strpath & strfilename))
Dim attach As New Attachment(Server.MapPath(strpath & strfilename))
msg.Attachments.Add(attach)
attach_file1 = strfilename
Dim smtpclnt As New SmtpClient()
Dim ds1 As New DataSet()
ds1 = CType(Session("Dataset"), DataSet)
msg.Subject = "You have successfully applied for the post of " & ds1.Tables(0).Rows(0).Item(2).ToString()
msg.Body = "Hi all"
'msg.To.Add(ds1.Tables(0).Rows(0).Item(9))
msg.To.Add("somemail@gmail.com")
msg.From = New MailAddress(Session("emailid").ToString())
smtpclnt.Send(msg)
If attach_file1 <> "" Then
File.Delete(Server.MapPath(strpath & strfilename))
End If
End Sub
but it gives me exception at
File.Delete(Server.MapPath(strpath & strfilename))
and it says
The process cannot access the file (filepath) because it is being used by another process.
any idea abt this error?
modified on Sunday, July 17, 2011 2:38 PM
|
|
|
|
|
Dear,
I want some idea from your mind.
Now assign a some value to current form as mystring variable.
I want mystring values, any where in the form.
the Request.QueryString() is get from previous form.
But I need the value any where in the project and any form without using
Response.Redirect() and Request.QueryString()
How to access the above matter.
Please tell me a your valuable advice. Above matter is working possible are not.
Kind regards
Thanking you,
abglorie
|
|
|
|
|
Hi,
You can use ViewState for this. or u also can use Cookie.
Happy Coding,
AS@13
A key to every Solution
|
|
|
|
|
Please give me a example code
Thanking you
|
|
|
|
|
Create a property and put it in session.
|
|
|
|
|
|
Session("mystring")=some value
It can be used any where in the application. Try this
|
|
|
|
|
Please read the forum guidelines. You have started several threads in which the message title has absolutely no meaning. Also, asking for the code is considered rude. You are expected to at least try programming and if you get stuck we will help.
|
|
|
|
|
hii
i have change my url name according to my requirment using global file concept
this is my function
void Application_BeginRequest(Object sender, EventArgs e)
{
String strCurrentPath;
String strCustomPath;
String StrReferrer;
if (Request.UrlReferrer != null)
StrReferrer = Request.UrlReferrer.PathAndQuery.ToString();
else
StrReferrer = "";
// for SubCategory
strCurrentPath = Request.Path;
strCurrentPath = strCurrentPath.ToLower().Replace("/RedTag/Client/".ToLower(), "");
if (strCurrentPath.StartsWith("subcategory.aspx"))
{
strCurrentPath = StrReferrer;
strCurrentPath = strCurrentPath.ToLower().Replace("/RedTag/Client/".ToLower(), "");
}
if (strCurrentPath.StartsWith("c-"))
{
string id = strCurrentPath.Split('-')[1].ToString();
strCustomPath = "category.aspx?catid=" + id.ToString();
Context.RewritePath(strCustomPath);
}
if (strCurrentPath.StartsWith("m-"))
{
string id = strCurrentPath.Split('-')[1].ToString();
strCustomPath = "subcategory.aspx?MFRID=" + id.ToString();
Context.RewritePath(strCustomPath);
}
if (strCurrentPath.StartsWith("s-"))
{
string id = strCurrentPath.Split('-')[1].ToString();
strCustomPath = "SubCategory.aspx?catid=" + id.ToString();
HttpContext.Current.RewritePath(strCustomPath);
// Context.RewritePath(strCustomPath);
}
if (strCurrentPath.StartsWith("p-"))
{
string id = strCurrentPath.Split('-')[1].ToString();
strCustomPath = "ItemPage.aspx?ProductID=" + id.ToString();
Context.RewritePath(strCustomPath);
}
}
now problem is that first time when my subcategory page load that time the url is like Client/s-1001-Data.aspx but when i do paging then my page is ispostback and my url change to SubCategory.aspx?catid=1001 means which is in
my Context.RewritePath ..i want the same url name should maintain through out the page...
Jintal Patel
|
|
|
|
|
hello sir
in my project i have one button view in excel.
In my project I have farpont spreadsheet when i click on view in excel button that time whatever we saw on farpoint spreadsheet that all save/view in excel spreadsheet.
guide me.
gayatri
Gayatri
|
|
|
|
|
Hi Gayatri,
Plz explain your query in details along with your code..and your problem.
Happy Coding,
AS@13
A key to every Solution
|
|
|
|