Showing posts with label access. Show all posts
Showing posts with label access. Show all posts

Wednesday, March 28, 2012

Installation problem - Urgent help needed

When installing the extentions on vista i get the following error "Error writing to file: System.Web.Extentions.Web.dll" Verify that you have access to that directory." I have turned UAC off and still get this error - can someone help as a matter of extreme urgency.

Kind Regards

Helga

Hi Helga,

I'm not aware of the accurate cause of this exception yet since it can be successfully on my vista.

May be you can try to install it into GAC manually, please refer to this thread: http://forums.asp.net/t/1134033.aspx

Hope this helps.

Monday, March 26, 2012

Integration with ViewState

Sometimes, I store information in the viewstate statebag. Since this information goes back to the server on a roundtrip, I have access to the information. If I want to send that same information back to the server, how should I handle the situation where the information is stored in the statebag? Should I go back and use hidden fields that javascript can get at? is there some type of way to reach into the statebag from the client-side javascript? I realize that the statebag is not considered to be secure so would it be possible to include some type of javascript decoder in atlas to get at values in the statebag?
WallyHi Wally,
I didn't see any viewstate support at the moment, and I think Microsoft is thinking of AJAX methods as I. If you try the Atlas web controls you will see that there is no Click event for the server.

I don't think we'll be creating solutions to change view state from the client. Often times this is not possible - view state may be encrypted. More often though, its simply not efficient to try and parse that content using script.

However, server controls that preserve the server-based programming model, while providing richer experience will use view state creatively, to provide the right behavior if an ajax-style page does need to postback for some reason.

Internal server error accessing scriptresource.axd

Hi.

I tried to ajax enable our existing web project, but iis7 just fails with a 500 - internal server error, when trying to access scriptresource.axd:

HTTP Error 500.0 - Internal Server Error
Description: Handler "ScriptResource" has a bad module "ManagedPipelineHandler" in its module list
Error Code: 0x8007000d
Notification: ExecuteRequestHandler
Module: IIS Web Core
Requested URL: http://localhost:80/dir/scriptresource.axd
Physical Path: D:\somewhere\dir\scriptresource.axd
Logon User: domain\my.username
Logon Method: NTLM
Failed Request Tracing Log Directory: C:\inetpub\logs\FailedReqLogFiles
Handler: ScriptResource

Creating a new asp.net ajax application works just fine, but ajax enabling out existing app fails. I am pretty sure the web.config is configured correctly. Anyone got any tips on how to resolve this?

hello.

hum... can you give us more details? for isntance, any stack trace? where are you hosting it? iis6?

thanks.


Trying to access the generated scriptresource.axd url just gives me a 500 - internal server error - not sure where to look for a stacktrace. Hosted on IIS7 running on vista. The app is using the classic asp.net app pool, using integrated windows authentication. Some details from the IIS trace:

MODULE_SET_RESPONSE_ERROR_STATUSWarning

ModuleName="IIS Web Core", Notification="EXECUTE_REQUEST_HANDLER", HttpStatus="500", HttpReason="Internal Server Error", HttpSubStatus="0", ErrorCode="The data is invalid. (0x8007000d)", ConfigExceptionInfo=""

The error appears after the HttpRedirectionModule NOTIFY_MODULE_END event, but before the CustomLoggingModule NOTIFY_MODULE_START event.

Not sure if this info is of any help...


Hi, thanks for reporting that. We have a bug open to track that issue. For the moment, if you can switch the application to integrated mode, that should fix it.
Please add preCondition="integratedMode" to the <add name="ScriptResource" .../> tag of the config file that's near the end, in the system.webserver section.

bleroy:

Please add preCondition="integratedMode" to the <add name="ScriptResource" .../> tag of the config file that's near the end, in the system.webserver section.

Thank you, that seams to work fine :)

Wednesday, March 21, 2012

Is it normal not see controls within a ReorderList?

I can't access any of my controls or their properties that are within my ReorderList Templates. Is this a normal behaviour for the ReorderList or I am I doing something wrong?

I tried .FindControl() and it doesn't seem to find them either.

Heres the markup for the reorderlist.

<cc1:ReorderListID="ReorderList1"runat="server"AllowReorder="True"Height="10px"PostBackOnReorder="False"ItemInsertLocation="End"ShowInsertItem="True"SortOrderField="DependOrder"DataKeyField="AutoID"Width="895px"><ItemTemplate><divclass="itemArea"><tablecellpadding="1"cellspacing="0"><tr><tdstyle="height: 13px;"><tableborder="0"cellpadding="0"cellspacing="0"><tr><td><asp:ImageButtonID="btnEdit"runat="server"ImageUrl="~/img/Edit.gif"CausesValidation="False"CommandName="Edit"/></td><tdstyle="width: 17px"><asp:ImageButtonID="ImageButton3"runat="server"CommandName="Delete"ImageUrl="~/img/Delete.gif"CausesValidation="False"/></td><tdstyle="width: 17px"><asp:ImageButtonID="ImageButton1"runat="server"CommandName="Edit"ImageUrl="~/img/View.gif"CausesValidation="False"/></td></tr></table></td><tdstyle="width: 10%; height: 13px;"><asp:LabelID="Label1"runat="server"ForeColor="black"Text="<%# ((HelpDesk.Task)Container.DataItem).AutoID %>"></asp:Label></td><tdstyle="width: 30%; height: 13px;"><asp:LabelID="Label2"runat="server"Text="<%# ((HelpDesk.Task)Container.DataItem).TaskName %>"></asp:Label></td><tdstyle="width: 30%; height: 13px;"><asp:LabelID="Label3"runat="server"Text="<%# ((HelpDesk.Task)Container.DataItem).AssignedTo %>"></asp:Label></td><tdstyle="width: 30%; height: 13px;"><asp:LabelID="Label4"runat="server"Text="<%# ((HelpDesk.Task)Container.DataItem).DueDate %>"></asp:Label></td></tr></table></div></ItemTemplate><DragHandleTemplate><divclass="dragStyle"><asp:Imagerunat="server"ImageUrl="./img/move6.jpg"/></div></DragHandleTemplate><ReorderTemplate><asp:PanelID="pnl2"runat="server"BackColor="Aqua"CssClass="reOrder"Height="40px"></asp:Panel></ReorderTemplate><EditItemTemplate><divclass="itemArea"><tableborder="0"cellpadding="0"cellspacing="0"><tr><tdstyle="width: 17px; height: 22px"></td><tdstyle="width: 21px; height: 22px"></td><tdalign="right"style="width: 101px; height: 22px">

Task:

</td><tdcolspan="5"style="width: 21px; height: 22px"><asp:DropDownListID="ddlTaskEMode"runat="server"DataSourceID="tblTask"DataTextField="TaskName"DataValueField="AutoID"></asp:DropDownList></td><tdcolspan="1"style="width: 21px; height: 22px"></td><tdstyle="width: 100px; height: 22px"></td></tr><tr><tdstyle="width: 17px; height: 168px"></td><tdstyle="width: 21px; height: 168px"></td><tdalign="right"style="width: 101px; height: 168px">

Note:

</td><tdcolspan="5"style="width: 21px; height: 168px"><asp:TextBoxID="txtNotesEMode"runat="server"Height="162px"Width="374px"></asp:TextBox></td><tdcolspan="1"style="width: 21px; height: 168px"></td><tdstyle="width: 100px; height: 168px"></td></tr><tr><tdstyle="width: 17px; height: 17px"></td><tdstyle="width: 21px; height: 17px"></td><tdalign="right"style="width: 101px; height: 17px">

Due Date:

</td><tdcolspan="3"style="width: 1px; height: 17px"><asp:TextBoxID="txtDueDateEditEMode"runat="server"ReadOnly="True"Width="146px"></asp:TextBox> </td><tdcolspan="1"style="height: 17px; width: 17px;"><imgid="Img2"src="img/calendar.gif"style="cursor: hand"/></td><tdstyle="width: 477px; height: 17px"><asp:ImageButtonID="btnReminderEMode"runat="server"ImageUrl="./img/Reminder.gif"OnClientClick="PopupReminder(700,500)"/></td></tr><tr><tdstyle="width: 17px; height: 42px"></td><tdstyle="width: 21px; height: 42px"></td><tdalign="right"style="width: 101px; height: 42px">

Dependancy:

</td><tdcolspan="1"style="width: 16px; height: 42px"><asp:RadioButtonListID="DependOrderEMode"runat="server"AutoPostBack="True"RepeatDirection="Horizontal"Width="152px"><asp:ListItemSelected="True">None</asp:ListItem><asp:ListItem>Order</asp:ListItem></asp:RadioButtonList></td><tdcolspan="5"style="width: 21px; height: 42px"><asp:TextBoxID="txtDependOrderEMode"runat="server"Enabled="False"Width="46px"></asp:TextBox></td><tdcolspan="1"style="width: 21px; height: 42px"></td><tdcolspan="1"style="width: 192px; height: 42px"></td><tdstyle="width: 100px; height: 42px"></td></tr><tr><tdstyle="width: 17px; height: 24px"><asp:ImageButtonID="btnSaveTaskEMode"runat="server"ImageUrl="./img/Save.gif"CausesValidation="False"OnClick="btnSaveTask_Click"/></td><tdstyle="width: 21px; height: 24px"><asp:ImageButtonID="btnUndoTaskEMode"runat="server"ImageUrl="./img/Undo.gif"CausesValidation="False"CommandName="Cancel"OnClick="btnUndoTaskEMode_Click"/></td><tdalign="right"style="width: 101px; height: 24px">

Assigned To:

</td><tdcolspan="3"style="width: 21px; height: 24px"><asp:TextBoxID="txtuserIDEMode"runat="server"></asp:TextBox></td><tdcolspan="1"style="height: 24px; width: 17px;"><asp:ImageButtonID="btnFindUserEMode"runat="server"ImageUrl="./img/binoculars.gif"OnClientClick="PopupUserMdp('userID',620,400)"/></td><tdstyle="width: 477px; height: 24px"> <asp:HiddenFieldID="userIDEMode"runat="server"/></td><tdstyle="width: 100px; height: 24px"></td></tr></table></div></EditItemTemplate><InsertItemTemplate> <asp:PanelID="DropInsert"runat="server"Height="30px"Width="85%"BackColor="#5D7B9D"ForeColor="White"><divstyle="padding:5px; vertical-align:middle; width:95%"><divstyle="float:left"><asp:LabelID="Label5"style="cursor:pointer"runat="server"Text="Insert New Task"></asp:Label> </div><divstyle="float:right; margin-left:40px"><asp:ImageID="Image2"runat="server"style="cursor:pointer"ImageUrl="./img/expand_blue.jpg"/></div></div></asp:Panel><asp:PanelID="pnlInsertTask"runat="server"Height="227px"Style="background-color: #ffff99"Width="439px"BorderStyle="None"BorderWidth="0px"><p> <tableborder="0"cellpadding="0"cellspacing="0"style="width: 454px"><tr><tdstyle="width: 17px; height: 22px"></td><tdstyle="width: 21px; height: 22px"></td><tdalign="right"style="width: 101px; height: 22px">

Task:

</td><tdcolspan="5"style="width: 21px; height: 22px"><asp:DropDownListID="ddlTask"runat="server"DataSourceID="tblTask"DataTextField="TaskName"DataValueField="AutoID"></asp:DropDownList></td><tdcolspan="1"style="width: 21px; height: 22px"></td><tdstyle="width: 100px; height: 22px"></td></tr><tr><tdstyle="width: 17px; height: 168px"></td><tdstyle="width: 21px; height: 168px"></td><tdalign="right"style="width: 101px; height: 168px">

Note:

</td><tdcolspan="5"style="width: 21px; height: 168px"><asp:TextBoxID="txtNotes"runat="server"Height="160px"Width="374px"></asp:TextBox></td><tdcolspan="1"style="width: 21px; height: 168px"></td><tdstyle="width: 100px; height: 168px"></td></tr><tr><tdstyle="width: 17px; height: 17px"></td><tdstyle="width: 21px; height: 17px"></td><tdalign="right"style="width: 101px; height: 17px">

Due Date:

</td><tdcolspan="3"style="width: 1px; height: 17px"><asp:TextBoxID="txtDueDateEdit"runat="server"ReadOnly="True"Width="146px"></asp:TextBox> </td><tdcolspan="1"style="height: 17px; width: 17px;"><imgid="Img1"src="img/calendar.gif"style="cursor: hand"/></td><tdstyle="width: 477px; height: 17px"><asp:ImageButtonID="btnReminder"runat="server"ImageUrl="./img/Reminder.gif"OnClientClick="PopupReminder(700,500)"/></td></tr><tr><tdstyle="width: 17px; height: 42px"></td><tdstyle="width: 21px; height: 42px"></td><tdalign="right"style="width: 101px; height: 42px">

Dependancy:

</td><tdcolspan="1"style="width: 16px; height: 42px"><asp:RadioButtonListID="RadioButtonList1"runat="server"AutoPostBack="True"RepeatDirection="Horizontal"Width="152px"><asp:ListItemSelected="True">None</asp:ListItem><asp:ListItem>Order</asp:ListItem></asp:RadioButtonList></td><tdcolspan="5"style="width: 21px; height: 42px"><asp:TextBoxID="txtDependOrder"runat="server"Enabled="False"Width="46px"></asp:TextBox></td><tdcolspan="1"style="width: 100px; height: 42px"></td><tdcolspan="1"style="width: 192px; height: 42px"></td><tdstyle="width: 100px; height: 42px"></td></tr><tr><tdstyle="width: 17px; height: 24px"><asp:ImageButtonID="btnSaveTask"runat="server"ImageUrl="./img/Save.gif"CausesValidation="False"OnClick="btnSaveTask_Click"/></td><tdstyle="width: 21px; height: 24px"><asp:ImageButtonID="btnUndoTask"runat="server"ImageUrl="./img/Undo.gif"CausesValidation="False"OnClick="btnUndoTask_Click"/></td><tdalign="right"style="width: 101px; height: 24px">

Assigned To:

</td><tdcolspan="3"style="width: 21px; height: 24px"><asp:TextBoxID="txtuserID"runat="server"></asp:TextBox></td><tdcolspan="1"style="height: 24px; width: 17px;"><asp:ImageButtonID="btnFindUser"runat="server"ImageUrl="./img/binoculars.gif"OnClientClick="PopupUserMdp('userID',620,400)"/></td><tdstyle="width: 477px; height: 24px"> <asp:HiddenFieldID="userID"runat="server"/></td><tdstyle="width: 100px; height: 24px"></td></tr></table> <cc1:CalendarExtenderID="CalendarExtender1"runat="server"Format="MMM-dd-yyyy"PopupButtonID="Img1"TargetControlID="txtDueDateEdit"></cc1:CalendarExtender><cc1:CollapsiblePanelExtenderID="CollapsiblePanelExtender1"runat="server"AutoCollapse="false"AutoExpand="false"Collapsed="true"CollapseControlID="DropInsert"ExpandControlID="DropInsert"CollapsedImage="img/expand_blue.jpg"ExpandedImage="./img/collapse_blue.jpg"ImageControlID="image2"TargetControlID="pnlInsertTask"></cc1:CollapsiblePanelExtender> </p></asp:Panel> </InsertItemTemplate></cc1:ReorderList>

Please recall that each controls' ClientID will be prefixed with a parent control ID... namely "ReorderList1__rliX_"

where X is the line item number of the list item. They will be prefixed more depending on how many parent controls they are in.


How are you trying to find them? Obviously specifying "RadioButtonList1" , for example, simply won't work.


It would be useful to know what control you are trying to access, and during what event.

In the code behind I am trying to grab the textbox value for example.

so something like this

private void btnSave_Click(object sender,EventArgs e)

{

string notes = txtNotes.Text

//Insert notes into Data Table

}

Error 1 The name 'txtNotes' does not exist in the current context.

And something like this

string

s = ((TextBox)ReorderList1.FindControl("ctl00_ContentPlaceHolder1_ReorderList1__rliInsert_txtNotes")).Text

comes back cant find the control.


Try this:

First of all btnSave_Click should be a protected method, not private.

code:

 
1protected void btnSave_Click(object sender, EventArgs e)2{3TextBox tb = (TextBox)ReorderList1.FindControl("_rliInsert").FindControl("txtNotes");4String s = tb.Text;5}
I hope this helps! (Please mark my post as the solution if this works for you)

Thank you that works!

Just wondering if there is a better way than hardcoding all the control names.


Not that I know of. You can also do it by index (I don't know if these are the actual indexes of your controls).

1protected void btnSave_Click(object sender, EventArgs e)2{3TextBox tb = (TextBox)ReorderList1.Controls[4].Controls[2];4String s = tb.Text;5} 

It seems more reliable to me to use the name since the addition of a single control could throw off all your indexes.