How To Replace SetExpression Method With Some Other Alternative In Code
Sep 16, 2010
I am trying to freeze my gridview header for last 2 days and got this link and many other links too provided to me on Stackoverflow as well as from googling. This worked fine when i used it on IE 6,7 and under compatibility mode in IE8 but in normal mode, this code is not working.
This line is giving me an error. I want to implement this functionality.
trs[x].style.setExpression("top", "this.parentElement.parentElement.parentElement.scrollTop + 'px'");
On reading comments, I came to know that scrollableTable.js uses setExpression Method which has been depreciated in IE8.
How to replace setExpression method with some other alternative in this code
[code]....
View 3 Replies
Similar Messages:
Apr 21, 2010
I loved the features of using app_offline.htm on my ASP.NET WebForm based sites.
Upload the file and your app is immediately "offline". Snappy.
Now that I'm using MVC 2, I noticed that this no longer works.
Is there a way to get this behavior in ASP.NET MVC 2 like it did in WebForms?
View 1 Replies
Mar 17, 2010
In uploading files and determining their length, I want to know if there is any alternative to
<code>
file1.PostedFile.ContentLength
</code>
It seems that this quantity is counted up as the actual uploading is taking place.
Once the customer has selected his file-to-be-uploaded and put it in the textbox, is there any
other way for my script immediately to say "This file is 5 Mb and it is therefore too big" ?
View 1 Replies
Aug 19, 2010
I have a table with 4 columns: ID, signId, storeNum, quantity with ID, SignId, and storeNum as composite primary keyif storeNum is -1, that means the quantity is the default quantity. If a store has a store-specific quantity, the storeNum is this store's number.
I need to show all rows that have specific quantity for a store, and all rows that have default quantity and of which the store does not have store-specific quantity
currently I use table-value function with storeNum as parameter to return the list. first, I get all rows that have specific quantity for a store; then, I use cursor to loop through all rows that have default quantity and check each row if the store has a specific quantity. It takes 9 seconds to run the function for a store.
The function is called within a stored procedure, which in turn is called by a function in a class, which in turn is called by a aspx code behind file. It takes about 20 seconds to load the page. 20 seconds to load a page is too long. I am trying to improve
the performance.
I wonder if there is an alternative method to the cursor to get the second part of the list.
View 3 Replies
Feb 1, 2011
i have just found that i cant create postback triggers on the fly (i had a function that runs onclick that creates buttons and postback triggers)
so i need an alternative or a method to achieve this
what happens is onclick of a button, updatepanel1 is updateded and depending on what button you click in panel1 more buttons are added, these buttons that are added also have an oncllick event that should update a wysiwyg in panel2 with content
heres my code below, if anyone has any ideas or knows of other methods to get this to work it would be great
[Code]....
View 23 Replies
Mar 15, 2011
How do you replace" with" using the replace method?
View 5 Replies
Aug 7, 2010
I want to iterate through HtmlTable (Server Side) in ASP.NET 3.5.
foreach (System.Web.UI.HtmlControls.HtmlTableRow trow in someTable)
{
var x = trow.InnerText;
}
I received an error message that "System.Web.UI.HtmlControls.HtmlTable" does not contain a definition for GetEnumerator.
How to write an extension method or alternative to make HtmlTable as enumerable row collection?
View 2 Replies
Oct 28, 2010
I have a hierarchy in my website project as below:
[CustomControl1 - folder]
- CustomControl1.ascx
- CustomControl1.css
- CustomControl1.js
I load css and js files dynamicaly based on which controls are used on particular page. I am doing it by using following code:
[code]....
where AddLinks method adds HtmlLink controls to Page.Header with href attribute set to coresponding css and/or js file.
I would like to add Interface that would force new controls to have AddLinks method but it is impossible since it is a static method. Because my custom controls inherit from Control class I cannot use abstract class and/or virtual methods either. How can I achieve my goal?
View 1 Replies
Jul 17, 2010
I have a textbox where I accept multiple email ids separated by a comma. I then split it in my code-behind. If an email id is invalid, I change the background of it using Regex.replace, like this:
Regex.Replace(InputTxt, Search_Str, StartTag & "$1" & EndTag, RegexOptions.IgnoreCase)
My start and end tags are definned as:
"<Span class=highlight>" and "</span>"and my CSS is defined
as:.highlight { text-decoration: none; color:black; background:yellow;}This doesn't work.
View 7 Replies
Jun 25, 2010
Our internal HR application is developed by the vendor, but I've been given a requirement to change the behaviour of a certain piece of functionality without their assistance (which I don't want to do, but am investigating...). The functionality in question is an .ashx page which does a number of database lookups, and is called via javascript functions on a web page. We want to add one further database lookup.
We have control over the javascript code, so that's not a problem, but the code for the .ashx page is held in a compiled assembly. I've found where it is, and looked into it using .Net Reflector. Reimplementing the methods involved wouldn't be difficult, if it were technically feasible.
Can I create a new assembly, paste the source taken using Reflector into it, make my modifications, add the DLL to the application, and then set up a new .ashx to refer to it?
The bits I'm worried about not being possible are:
The code refers to some vendor classes held in other assemblies; can I just add references to those assemblies in Visual Studio to allow it to compile, and then when it's compiled and put on the server it'll all work?
Will I have trouble getting the web application to accept the new DLL, given that generally this application is not something we make changes to ourselves?
EDIT:
Some clarification: I'm not actually planning to replace the vendor's DLL with one of my own, that does sound like going a bit too far. Instead, I would make a new DLL with just the one function in it I need (based on stuff taken from the existing DLL using Reflector). I'd need that code to reference other utility vendor code so that it can get at classes needed to access the framework. I'd make a brand new .ashx page to serve up the code in the new DLL.
Luckily after all this I'm off the hook, because my customer agrees that things aren't desperate enough for us to attempt all this!
View 2 Replies
Dec 11, 2010
I have a long string containing the ,<p> </p> and <br>. I want to clean my string from all these tags and spaces. How it can be done with String.Replace() method. I am doing separately right now, it is working but is there a way to do it at once, without replace() method.
String.Replace(" ","").Replace("<p>","").Replace("<br>","")
It is giving me clean code but I am looking for a general solution, means if I am having more tags (10 to 20) to filter then how to do it efficiently.
View 5 Replies
Oct 29, 2010
In a asp.net page, I want to replace the code following to CSS but do not work as expected. How to fix it? (Border-color, ForeColor did note work)
<asp:Label ID="lbl01" runat="server" BorderColor="#B4DAFA" BorderStyle="Solid" BorderWidth="1px" Font-Size="Small" ForeColor="Blue" Style="z-index: 1; left: 3px; top: 10px; position: absolute; height: 14px; width: 325px" Text="Label"></asp:Label>
.LabelStyle
{
clear: left;
float: left;
margin: 5px;
height: 14px;
width: 325px;
Border-Color:#B4DAFA;
Border-Style:Solid;
Border-Width:1px;
Font-Size:Small;
Color:Blue;
}
View 1 Replies
Apr 15, 2010
I am receiving the contents of a file via ftp. I don't want to go into every detail (unless needed), but I am working with existing code that was using 3rd-party software to get ftp files. I am replacing that with .NET code. But I want to replace as little as possible of the existing code that is not specifically using the 3rd-party s/w. So I am trying to use a class originally written by the author of the code (a former employee).
This is his class constructor:
Code:
Public Sub New(ByVal fileName As String, ByVal content As StreamReader)
Me.FileName = fileName
Me.Content = content
Me.TimeStamp = Date.Now
End Sub
So I need to pass a StreamReader. My problem is how to get one.
In my procedure ReceiveFile(), I execute this code:
Code:
Private Shared Sub ReceiveFile(ByVal sFilename As String, ByRef objMemoryStream As System.IO.MemoryStream)
Try
Dim request As FtpWebRequest = DirectCast(WebRequest.Create("ftp site and folder" & sFilename), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.DownloadFile
request.Credentials = New NetworkCredential("id", "pw")
Dim response As FtpWebResponse = DirectCast(request.GetResponse(), FtpWebResponse)
Dim responseStream As Stream = response.GetResponseStream()
Dim reader As New StreamReader(responseStream)
Dim sFile As String = reader.ReadToEnd
'reader.Close()
' response.Close()
'objMemoryStream = responseStream
Dim objStream As System.IO.MemoryStream
objStream = New System.IO.MemoryStream(Convert.FromBase64String(sFile))
' objMemoryStream = Convert.FromBase64String(sFile)
objMemoryStream = objStream
'Return reader
Catch ex As Exception
Dim i As Integer
i = 10
End Try
End Sub
responseStream is declared as a stream but when I query it in the debugger it says it's an FtpDataStream, after it's set equal to response.GetResponseStream. I want to take that stream and somehow get it into a MemoryStream. I thought I found the solution this morning via Convert.FromBase64String, but when I ran I got an exception saying "Invalid character in a base-64 string", and I think it's because of the newline character in the string. The file that's received contains three lines separated by a newline character.
View 22 Replies
Jul 29, 2010
I have a page, which is called from 2 different functions. For each function, the page has to be display different image. I have 2 images. On the aspx page, code is like this. Please help me out how to display different image for different functions!
View 1 Replies
May 12, 2010
I want execute below callback() method after completion of document.getElementById('btnDownload').click(); method . Now callback()executing immediatly. I want wait "Click()" process done then Execute callback(); method.
function LoadPopup() {
// find the popup behavior
this._popup = $find('mdlPopup');
// show the popup
this._popup.show();
// synchronously run the server side validation ...
document.getElementById('btnDownload').click();
callback();
}
function callback() {
this._popup = $find('mdlPopup');
// hide the popup
this._popup.hide();
alert("hi");
}
View 2 Replies
Mar 19, 2010
I tried putting a html replace code into a string which is then placed into a drop down menu. Only problem is it still appears as ² instead of a small 2.
View 5 Replies
Apr 12, 2010
In ASP.NET 4.0 RC2 the Menu Control by default emits Javascript like this:
[Code]....
There should be a feature coming up to disable this, but I think it's not in RC yet. At least it's not working for me.
Now, the problem is, that this Javascript kills my own Menu Javascript (I use an CSS Adapter). Is there a way to overwrite the stuff that comes from the Menu control? Can be a hack, just need something until this is fixed by MS.
View 2 Replies
Jan 25, 2011
I have a web method in my code behind:
[System.Web.Services.WebMethod]
public static string GetStateData(string state)
{
//this is where i want to call a javascript method "GetItems"
}
I have a javascript method that retrieves some values for me and I want to get use one of those values in my web method
function GetItems() {
var variable1= $("#<%=Item1.ClientID %> input:checked");
var variable2= $("#<%=Item2.ClientID %>").val();
return [variable1.text(), variable2.val(), variable2];}
I've searched for ways to call the javascript method from the web method but every time my search results in how to call a web method from javascript.
I did find this but it was done from the code-behind of a silverlight project and when I tried adding the correct reference to my code-behind it wasn't there
var result = HtmlPage.Window.Invoke("GetItems"); Is there a reference I'm missing?
View 2 Replies
Jul 16, 2010
I am working with a few .Net 4.0 webforms controls such as the Menu control and while I think it's great that I can now declare the way in which controls are rendered (i.e. as either tables or divs), I can't switch off the automagically-included javascript that manages the hover events for those controls, for example:new Sys.WebForms.Menu({ element: 'NavigationMenu', disappearAfter: 500, orientation: 'horizontal', tabIndex: 0, disabled: false }This appears at the bottom of every page that owns such a control.
View 1 Replies
May 18, 2010
how do you call code behind button click event or a code behind method
from javascript.
View 8 Replies
Jun 18, 2010
I need to replace <span> entries in a string to legacy html code because it's going to be used in a report for Crystal Reports. <b> works with Crystal, but the<span>'s do not.
Here's the string which I'm trying to replace: <span style="font-weight: bold">%THIS CAN BE ANY TEXT%</span>. I want to replace it to
<b>%THIS CAN BE ANY TEXT%</b>.
[Code]....
View 5 Replies
Sep 24, 2010
I added the extender and when i tried to add the method this message poped up; Cannot create page method "GetCompletionList" because no Code Behind or codefile was found.
View 4 Replies
Feb 21, 2011
I'm writing a send sms code. In that, I've to replace "&" character. Actually if anyone writes &, it sends data before &. Suppose someone writes "I & u" it sends I only. For this I wrote some solutions like this but it doesn't works :
mData = Regex.Replace(mData, "&", "&")
mData = Replace(mData, "&", "%20")
View 3 Replies
Feb 17, 2011
I am just learning ASP.Net and i am more using C# as code behind than vb.I am trying to call a method of the code behind (file.aspx.cs) from the (file.aspx).I know how to do it the easy way:- create a button from ASP.Net and double click on it than the property "onclick" will be linked to the method.But i don't know how to do it from a query:
- By example, from an Access database,i use the syste, [using System.Data.OleDb;] and i made a query and display it into a standar object named "Table" which has rows (tablerow) and cells (tablecell) and the cells have one of their properties which is "Controls" where developers can add button (regular button, image button, link button, etc). With i display the buttons from the database, i can not call a method from code behind! I can't either use their properties "onclick" to call i method i created in the code behind.Is there a way to do it ?
View 5 Replies
Jun 11, 2010
I am trying to execute a method in ASP.NET from Jquery
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "MyMessages.aspx?id=66&epslanguage=sv/test",
data: "{}",
dataType: "json",
error: function(xhr, err) {
alert("readyState: " + xhr.readyState + "
status: " + xhr.status);
alert("responseText: " + xhr.responseText);
},
success: function() {
alert("it works" );
}
})
code behind:
[WebMethod]
protected void test()
{
test.Text = "works";
}
I get errormessage redayState: 4 and status 200 when I do this. I don't understand the problem. I am vey new at this. :)
View 1 Replies