function
RequestHandler(comboBox, text, more)
{
var
intMinChar = 2;
var
txtLength = text.length;
if
(txtLength == undefined || txtLength <= intMinChar)
{
return false;
}
}
The above code worked fine.
But with the 2008 version we are using the below code:
function
OnClientItemsRequesting(sender, eventArgs)
{
//var context = eventArgs.get_context();
alert(eventArgs.get_text().length);
return false;
}
I am using the above code to test whether we are able to stop from firing the ItemRequested server side event.Even though i am returning false always.I am not able to stop firing the ItemRequested event.
<
CommandItemTemplate>
<asp:ImageButton ID="ImageButton1" CommandName="InitInsert"
ImageUrl="~/resources/btnAdd.gif" runat="server" Height="27px" Width="75px" />
</CommandItemTemplate>

<
div id="divInbox" runat="server" style="float: left; width: 250px;">
<asp:Panel ID="pnlInbox" runat="server" Visible="True">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td align="center" style="width: 74px" valign="middle">
<asp:ImageButton ID="btnInbox" runat="server" ImageUrl="/cop/portal/images/gfx_myInbox.gif" />
</td>
<td>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td style="height: 25px">
<asp:LinkButton ID="lnkInbox" runat="server" CssClass="midLink"> Inbox</asp:LinkButton>
</td>
</tr>
<tr>
<td class="homeLabelnotBold">
View messages you have received.</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
</div>
<div id="divOutbox" runat="server" style="float: left; width: 250px;">
<asp:Panel ID="pnlOutbox" runat="server" Visible="True">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td align="center" style="width: 74px" valign="middle">
<asp:ImageButton ID="btnOutbox" runat="server" ImageUrl="/cop/portal/images/gfx_myOutbox.gif" />
</td>
<td>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td style="height: 25px">
<asp:LinkButton ID="lnkOutbox" runat="server" CssClass="midLink">Outbox</asp:LinkButton>
</td>
</tr>
<tr>
<td class="homeLabelnotBold">
View messages you have sent to recipients.</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
</div>
Hi,
I have one default page (default.aspx) inside that i have one user control containing rad grid.
On click of the link button (which is one column in grid) i am opening the rad window.
On click of update button (which is inside rad window ) i want to close the rad window and refresh the calling page (default.aspx).
It closes the rad window but could not refresh the calling Page(Default.aspx).
Please assist.
Code in rad window.
<script type="text/javascript">
function CloseAndbind(status)
{
var obj = GetRadWindow();
obj.CallBack(status);
}
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well)
return oWindow;
}
</script>
code in calling page (default.aspx)
<script type="text/javascript">
function CallBackFunction(radWindow,returnValue1)
{
callButtonClick();
}
function callButtonClick()
{
var _btn = document.getElementById('<%= Button1.ClientID%>');
_btn.click();
}
</script>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behaviors="Close,Move,Reload"
Modal="true" Animation="None" ClientCallBackFunction="CallBackFunction" ShowContentDuringLoad="true" VisibleStatusbar="true"
Skin="WebBlue">
<Windows>
<telerik:RadWindow Width="910px" Height="640px" ClientCallBackFunction="CallBackFunction"
Runat="server" Id="Radwindow1"
VisibleStatusbar="false" >
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
I am trying to upload files to a database and then let the user download them again.
But when I upload a small file, it seems like only few kB actually make it into the database. The progress bar shows up for a split second only and then disappears. The entry is written is to the database but the binary content is too small.
When I upload a large file (e.g. 10 MB), I get a "page cannot be displayed" error.
Any idea? Thanks so much! s.
Here's some code:
aspx:
<
telerik:RadUpload ID="RadUpload" runat="server" Skin="Telerik" InitialFileInputsCount="1" Width="620px" ControlObjectsVisibility="None" InputSize="100" OverwriteExistingFiles="True" />
cs:
| protected void SaveButton_Click(object sender, EventArgs e) |
| { |
| if (RadUpload.UploadedFiles.Count > 0) |
| { |
| // Obtain the USER ID from the Session |
| this.userid = HttpContext.Current.Session["USERID"].ToString(); |
| if (String.IsNullOrEmpty(this.userid)) |
| this.userid = SATConfiguration.LocalUser; |
| // Obtain the description and clear it of "junk" |
| this.description = Regex.Replace(this.DescriptionTextBox.Text, "[\t\r\n\v\a\b\f\0\\\'\"]", String.Empty, RegexOptions.Compiled); |
| // Get the file and its name |
| file = RadUpload.UploadedFiles[0]; |
| filefilename = file.GetName(); |
| //Read the file |
| bytes = new byte[file.InputStream.Length]; |
| file.InputStream.Read(bytes, 0, (int)file.InputStream.Length); |
| // Call the stored procedure AddAttachment with its parameters |
| using (SqlConnection conn = new SqlConnection(SATConfiguration.SatConnectionString)) |
| { |
| try |
| { |
| // Open a new connection |
| conn.Open(); |
| // Create a command object identifying the stored procedure |
| SqlCommand cmd = new SqlCommand("AddAttachment", conn); |
| // Set the command object so it knows to execute a stored procedure |
| cmd.CommandType = CommandType.StoredProcedure; |
| // Add parameters to command, which will be passed to the stored procedure |
| cmd.Parameters.AddWithValue("@userid", this.userid); |
| cmd.Parameters.AddWithValue("@caseid", this.caseid); |
| cmd.Parameters.AddWithValue("@filename", this.filename); |
| cmd.Parameters.AddWithValue("@description", this.description); |
| cmd.Parameters.AddWithValue("@attachment", this.bytes); |
| cmd.ExecuteNonQuery(); |
| cmd.Dispose(); |
| } |
| catch (Exception ex) |
| { |
| log.Error("Exception while writing attachment to database", ex); |
| } |
| finally |
| { |
| // close the connection |
| conn.Close(); |
| } |
| } |