
Hi everyone,
I have a scenario where I insert just the filename of the file I upload in the database. For this I upload a file to the server and retrieve the filename and then save the entity. But if I set the AjaxControlID="btnSave" I get en error saying object reference.
below is the code:
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="LoadingPanel1"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="btnSave"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="lblInfo" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager>
<form id="form1" runat="server">
<asp:label id="lblInfo" runat="server"/> asp:FileUpload ID="image" runat="server" />
<asp:Button ID="btnSave" runat="server" Text="Save"
onclick="btnSave_Click" /> </form> |
and in the code behind I have the following:
| private String GetUploadImageName() |
| { |
| if (image.PostedFile.ContentLength > 0) |
| { |
| //upload the file |
| image.PostedFile.SaveAs(Server.MapPath("~\\Resources\\Images\\ExcerciseImages\\" + |
| txtName.Text.ToString() + ".jpg")); |
| return txtName.Text.ToString() + ".jpg"; |
| } |
| else |
| { |
| return ""; |
| } |
| } |

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0)
Timestamp: Sat, 13 Dec 2008 01:03:15 UTC
Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near ' <!DOCTYPE html PUBL'.
Line: 5
Char: 62099
Code: 0
URI: https://mysite/ScriptResource.axd?d=KWDi80_EFVyd0lJKPGt0u4LMBeD4BRLLi6Y3mtz4y4oXekQgFa1VpiUAAuq-nJQToR0QGYtQVbQDhcR_SPhbUAn_gjgB9xbE1Sa_wT2WICs1&t=ffffffffdc3e45b1
[Latest November 2008 toolkit, VS 2008 .Net 3.5 SP1, using the RADGrid Inside Update Panel. Page has toolkitscript manager (Microsoft Control)]
The older RadGrid control (1 year old) had not such issues, but was slower

<asp:SqlDataSource ID="Sql_docket" runat="server" SelectCommand ="SELECT DOCKET.DOCKETID ................... FilterExpression ="reject='{0}'" >
<FilterParameters>
<asp:ControlParameter Name="reject" ControlID="RadComboBox_reject" PropertyName="SelectedValue" Type="Boolean" ConvertEmptyStringToNull="true" />
</FilterParameters>
</asp:SqlDataSource>
Basically, my idea is to set "RadComboBox_reject" property "AutoPostback" = true, so that everytime user choose option from RadComboBox_reject, the selectedValue will be passed to sqldatasource by SqlDataSource FilterParameters.
The above code is working fine. But, now, I am trying to add "Get All" option to "RadComboBox_reject", so that RadGrid will show all records when user select "Get All". My question is: what value should be for "Get All" option that will be passed to FilterParameters? Please note that FilterParameters type is "Boolean".
Thank you very much
| <script type="text/javascript"> |
| function pageLoad() |
| { |
| var upload = $find("<%= RadUpload1.ClientID %>"); |
| var uploadDiv = upload.get_element(); |
| var input = document.createElement("input"); |
| input.type = "submit"; |
| input.className = "ruButton"; |
| input.value = "Upload My XML Now"; |
| input.id = input.name = upload.getID("submit"); |
| //the UL element of the upload |
| var ul = uploadDiv.getElementsByTagName("UL"); |
| //the array of all LI elements of the UL element |
| var LIs = ul[0].getElementsByTagName("LI"); |
| //Last LI item - the button area |
| var lastLi = LIs[LIs.length - 1]; |
| lastLi.appendChild(input); |
| } |
| </script> |
