|
Hi,
How we can detect browser-close (x) event in asp.net?
Anybody has some idea .please let me know
Regards
Rajesh
|
|
|
|
|
There's no good way to detect the close button of the browser, but there are some events of the window object like onbeforeload,onload which are close to what you want.
|
|
|
|
|
Anybody know of any good free ASP hosts out there? (Besides Brinkster)
Don't need a lot of storage, just something stable to test on.
Isaac Sasson
"I hate it. Java sucks. And Java's generics suck harder. And in general, Java just sucks."
- David Stone, The Lounge (May 1st 2006)
|
|
|
|
|
Hi David,
I had hosted my asp site last year in domaindlx.com. I've heared, somebody else has purchased the site so I don't no whether they are still in free hosting or not. Anyway, ASPSpider.net is still providing free space without any banner.
for asp - domaindlx.com
for asp.net (2003) www.aspspider.net
says Neeraj.
Neeraj
|
|
|
|
|
Thanks a lot!
And by the way I'm Isaac not David
Isaac Sasson
"I hate it. Java sucks. And Java's generics suck harder. And in general, Java just sucks."
- David Stone, The Lounge (May 1st 2006)
|
|
|
|
|
as a newbie, I have developed a simple administrative app that lists members of our mailing list. ON the viewing page, checkboxes are dynamically listed along with the member info. When one checks a box and clicks 'edit', i want the item checked to open into the edit page with it's appropriate data. Problem: I can get the checkbox associated to an id number on the viewing page. I just can't seem to figure out how to send that id and data to the edit page. any help or suggestions would be great. can provide code examples if needed.
karinb
karinb
|
|
|
|
|
in the querystring if it's just simple data...
|
|
|
|
|
From viewing page you can use code similar to this
Dim trans_id As Integer
Dim dgrCode As Label = E.Item.FindControl("lblCode")
trans_id = CType(dgrCode.Text, Integer)
Server.Transfer("EditList.aspx?&trans_id=" + trans_id.ToString(), True)
which does this: reads value from control named lblCode.
Since I needed to transfer this value to next page as integer, I casted it.
Last line of code redirects user to "edit list" page along with value from the control
In Edit List page under Page Load or somwhere else have line similar to this.
lblTest.Text = Request.Params.Get("trans_id")
What this does: it reads a parameter sent from viewing page and assign its value to text box.
I hope this gives you the general idea
Srdjan
|
|
|
|
|
I truly appreciate your solution, just wish i could figure out how to implement it. i should have mentioned i'm developing in c#. Here's what I've tried to do with your sample:
--this is in my Page_Load---
--creates an instance of a checkbox and dynamically populates inline with the list of users and sets its value to the same as the pk of the associated dataset---
CheckBox cboCheck = new CheckBox();
cboCheck.AutoPostBack = false;
cboCheck.ID = dsUserInfo.Tables[0].Rows[intCtr]["intMailIDpk"].ToString();
---Event Handler
public void btnEdit_Click(object sender,System.EventArgs e)
{
--->getting error message at this line: Object reference not set to an instance of an object.--
Int16 ckID = Convert.ToInt16(cboCheck.ID);
cboCheck.ID = Convert.ToString(cboCheck.FindControl("ckID"));
Server.Transfer("addedit.aspx?&ckID=" + ckID.ToString(), false);--probably need to user Response.Redirect here, you think??--
}
any help is greatly appreciated. i'm sure i'm just one line of code off here, and then my app works great.
karinb
-- modified at 15:11 Tuesday 9th May, 2006
|
|
|
|
|
You will find lots of useful .Net material in this site
Visit this site
http://www.dotnetguide.co.nr
|
|
|
|
|
dotnetguide wrote: Visit this site
I will certainly not.
---
b { font-weight: normal; }
|
|
|
|
|
Iam using livecontrols, but a sometimes the browser put this message..
The server viewstate cache has timed out..
|
|
|
|
|
I have the following DataList
<div style="overflow:scroll;">
<asp:DataList ID="dlAvatar" runat="server" DataKeyField="FileName" RepeatLayout="Flow" RepeatDirection="Horizontal" SelectedItemStyle-BorderStyle="Inset" >
<ItemTemplate>
<asp:ImageButton ID="imgAvatarSelect" runat="server" OnCommand="Buttons_CommandEvent" ImageUrl='<%# Eval("FileName") %>' CommandArgument='<%# Eval("FileName") %>' CommandName="Select"/>
</ItemTemplate>
</asp:DataList>
</div>
When I use Inline for the "CommandArgument" My onCommand event wont get fired, but when I take it out it works fine.
I I found the control like this inside my code behind:
//void dlAvatar_ItemCreated(object sender, DataListItemEventArgs e)
//{
// int i = 0;
// object a = e.Item.FindControl("imgChoose");
// ImageButton a2 = a as ImageButton;
// if (a2 != null)
// {
// a2.CommandArgument = ((AvatarPicture)e.Item.DataItem).FileName;
// }
//}
but, it finds the control and sets the value. but the commandArgument never changes its value.
And yes, its commented out because it wasnt working.
Any ideas?
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: but, it finds the control and sets the value. but the commandArgument never changes its value.
+ Are you sure you want to use the imgChoose or imgAvatarSelect id?
+ Here, you are trying to set the CommandArgument property of the imagebutton in both the ItemCreated handler and the data binding expression. And you may already know that the ItemCreated event happens before the data DataBound event where the binding expression is normally executed. So if you want to use the ItemCreated event, you should not use the data binding expression, otherwise the CommandArgument property will be reset.
|
|
|
|
|
I tried at just usiing the data binding expression. And it wont fire. But if I delete the CommandArgument it doesn't fire. ( OnCommand event )
Maybe I should create the the DataBind event, that might be a work around.
I did the ItemCreated out of desparation.
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Ista wrote: I tried at just usiing the data binding expression. And it wont fire. But if I delete the CommandArgument it doesn't fire. ( OnCommand event )
Normally, you only need to use the data binding expression to simply set the CommandArgument property of the ImageButton. Have you tried using the ItemCommand event of the DataList control and see if it is fired? Have you viewed the page source and checked the id/name of the imagebutton?
|
|
|
|
|
Ok so I changed the Created to be like this:
void dlAvatar_ItemCreated(object sender, DataListItemEventArgs e)
{
int i = 0;
object a = e.Item.FindControl("imgChoose");
ImageButton a2 = a as ImageButton;
if (a2 != null)
{
//a2.CommandArgument = ((AvatarPicture)e.Item.DataItem).FileName;
a2.Command += new CommandEventHandler(Buttons_CommandEvent);
a2.Click += new ImageClickEventHandler(btnAdd_Click);
}
}
it find the control fine. and I add the handlers fine. no errors. But the Image is never posting back. This is just unreal. Is there a property that has to be set to allow posting back?
I'm caught in a nightmare
And to add. I put a regular button on the form and its not posting back.
This page belong to a master page. Do you have any idea why a page wont post back?
1 line of code equals many bugs. So don't write any!!
-- modified at 10:08 Friday 5th May, 2006
|
|
|
|
|
Thanks for helping min.
The reason was, my master page was set to "get". I changed it from "get" to "post" and it works fine.
I guess I had a brain fart.
thanks,
Nick
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
hi,
whats am doin is that when a client uploads a word documents using a local site this word doc should be copied to the root of the server in a shared folder(read,write,... all options are checked)
the problem occurs when trying to copy this doc
it throws an exception
URI formats are not supported!!!!!
is there anything in the network setting i can do????
|
|
|
|
|
Hi
I have created a web project in ASP.NET , I want to process one more ASP.NET page which resides in some other virtual dirctory.
Using Server.Execute is not working and giving error
Please help.
Thanks in advance.
N.A.
|
|
|
|
|
Hi!
I have created a new web site on IIS 6.0 running on Windows server 2003 std edition.
When i go to the IIS console and browse my web site , it displays an error message as follows:
"You are not authorsed to view this page".
You might not have the permission to view this directory or page using the credentials you supplied.
Can anyone help?
Thanks.
happy coding!
|
|
|
|
|
If you have the web site in a directory outside of the wwwroot, the aspnet worker account will require read access to that folder.
|
|
|
|
|
I get this sometimes, when I don't specify a page in the url and don't have an appropriate "default" page.
If I navigate to an actual page, then all is good, and if I add the non-standardly named page as a default document, then all gravy....
Could this be the issue in your case?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
it is because of default page.
the code write in web.config
when not any page like "default.aspx" then it will give error.
so u should create page like default.aspx or redirect the page by writting response.write("anyfile.aspx")
Dipan Patel.
|
|
|
|
|
Hi all
I have created a asp.net project under visual studio .net 2 and it all works fine. However when I upload it to my server it will not run because it is not a virtual directory that it resides in. Is there any way to make it so that I don’t have to use virtual directories and some how get it to work out where my dll’s are? Iv been looking at the config file to see if there is any way I can hard code where to point to the bin folder but as of yet I have not had much luck.
Any help would be grate.
Thx Scott.
|
|
|
|