|
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.
|
|
|
|
|
Why can you not just make it a virtual directory?
|
|
|
|
|
I do not have the option to create them with the web host I am with. I know that you don't need them if you don't use code behind but it rather not have to go through all my code and stick it into the same file.
|
|
|
|
|
New web host maybe
|
|
|
|
|
As long as MasterPage and WebForm are in the same directory the JavaScript file works but when the directories are different I get javascript error cuz the file was not found.
I tried to google this problem and found that if you put the script block within the < HEAD >, ASP.NET 2.0 runtime will resolve the URL but for some odd reason that is not the case here.
Here is how I am doing it:
the file is inside a folder called JavaScript which is right under root folder.
I tried this first:
<head>
<script src="/Javascript/x.js" type="text/javascript"></script>
</head>
Then I tried this:
<head>
<script src="x.js" type="text/javascript"></script>
</head>
Then I tried this, but I got an ugly error:
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
<head>
<script src=<%= ResolveClientUrl("x.js") %> type="text/javascript"></script>
</head>
Can someone tell me how to take care of this problem . Thanks in advance.
-- modified at 8:58 Thursday 4th May, 2006
|
|
|
|
|
Hi,
Try below code,
<script src="../Javascript/x.js" type="text/javascript"></script>
Hope it works...
|
|
|
|
|
Thanks for the reply, but
<script src="../Javascript/x.js" type="text/javascript"></script>
does not work.
|
|
|
|
|
Hi,
Try below code,
<script src="../Javascript/x.js" type="text/javascript"></script>
Hope it works..
|
|
|
|
|
Check if the framework resolves this:
<script src="~/Javascript/x.js" type="text/javascript"></script>
---
b { font-weight: normal; }
|
|
|
|
|
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>
I had it working in the file "ViewUser.aspx". Then I moved it to a page called "ChooseAvatar.aspx". It was working there too. Then, I moved it back to "ViewUser.aspx". And now it doesn't work.
It doesn't fire my event which is defined as so.
public void Buttons_CommandEvent(object sender, CommandEventArgs e)
{
int i = 0;
User user = Session["user"] as User;
if (user != null)
{
user.Avatar = Convert.ToString(e.CommandArgument);
user.Update();
if (user != null)
imgAvatar.ImageUrl = user.Avatar;
}
}
Is there some option is VS2005 IDE to get it to re-sync my page? Any ideas?
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
Nevermind. The IDE is a piece of crap. I re-created the button and it finds the event now.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
hi,
suppose that i have the string value "http://www.google.com" as NavigationUrl.
how can i load this page into a div running at server?
thanx
|
|
|
|
|
|
but how?
because "TreeNode.Target", having the value of iframe id "ifrUrl", did not work.
Do i have to run javascript? how?
thanx
|
|
|
|
|
Hello Friends,
I have a webform. There are 11 "RequiredFieldValidator" controls on this web form. If something goes wrong then validation controls warn me. That's ok.
There is another button on this webform that navigates to another webform.When I click this button validation controls dont allow me to navigate.
But suppose that I will do nothing on this page and I will navigate another page..How can I disable the effect of these validationcontrols when I click the button.
Please Help..
|
|
|
|
|
Hi innocent73,
just make the "CausesValidation" property of that Button(for which you dont want the validation to be executed)to
"False".
Tirthadip
|
|
|
|
|
Thank you so much....That's the answer!!
|
|
|
|