DevExpress Generates Thousands Of Lines Of ASP Code / How To Reduce The Code,
Nov 24, 2010
After insert a grid or any other tool into an aspx page it generates enough code for that tool(for ex.): <dx:ASPxGridView ID=ASPxGridView1 runat="server"></dx:ASPxGridView>...
But,after adding any property to this control (like Show group Panel) it generates more than 3000 lines of code in aspx page () and after adding any other tool the code is increasing in a enormous way...
How can I reduce the code, maybe there is a property(settings) in DevExpress option...
View 2 Replies
Similar Messages:
Dec 13, 2010
I have a DevExpress grid that needs to be refreshed every time the value in a combobox is changed. For example, I have a combobox that sets the grid's page size. One of the requirements is that the combobox does not cause a full postback.
The combobox is declared like this:
<asp:DropDownList ID="cboPages" AutoPostBack="false" runat="server"
EnableViewState="false" OnSelectedIndexChanged="cboPages_SelectedIndexChanged" />
On selected index changed, it sets a cookie whose value is the selected value. When the combobox value changes, a javascript function is called:
function PerformCallbackOnGrid(grid) {
try {
grid.PerformCallback("refresh");[code]....
The function is attached in code behind: this.cboPages.Attributes["onChange"] = "PerformCallbackOnGrid(" + this.GridClientID + ")";
After performing these steps:The user changes the grid page size using the combobox, so PerformCallback is called at least once.
The user presses F5(refresh).
The user tries to change the page size again.
an 'Invalid viewstate' error message appears.
I have tried setting ViewStateMode to Disabled for the grid, also EnableViewState="false".
View 2 Replies
Nov 26, 2010
we try to disable a server control at code behand, say:
[Code]....
and obviously the above html/xhtml is not W3C compliance, it always compplians disabled is not a valid attribute. I am pretty sure there are heaps of ppl who would like to develop w3c complianced web application suffer this issue.I was searching on internet without any luck, could someone in here shed me a light or Will Microsoft do sth about it in the near future.
View 7 Replies
Mar 18, 2011
I am using a sql server 2008 database and I am uploading images to the server using an asp.net webapplication. I have an image column that I use to store the images. I have chosen the database to store the image and not a folder on the server, because the database table will contain only very few rows. maybe close to 10 or 15 rows.
My question is, Do I have to reduce the size (dimensions and quality affecting size on disc in kbs) of the image in code behind before uploading it to the database or do I keep it as is. The total upload size permitted is 200kb. I am thinking that when the image size (size in kbs) is small my webapplication performance will not be affected when displaying them from the database.
View 6 Replies
Nov 1, 2010
So I am a beginner with .NET, Visual Studio, C#, etc. But I am wondering something about the code behind a form and a difference I am seeing in 2008 versus 2005. So lets say I have a simple Windows Form app, C#, and I throw a couple controls on it. Then I add some MessageBox.Show event handlers for the default events....in 2005 there is that little section within the code that is hidden that basically contains the code that 'registers' the controls with the system....I think. That may be a bad definition?? Basically I think that automatic code generated here just basically associates the event to the event handling code....anyway.
I can see this is 2005 (once I click the like gray box), but it does not appear anywhere in 2008. So this has to exist somewhere, and I just wanted to ask to be familiar with what is going on since I am new to this. I still have to figure out how to turn on the code line numbering in 2008, but I can google it.
View 2 Replies
Jan 11, 2010
Not sure if this is the right forumn for this kind of question.Basically I have just started with MVC and also have done simple programming and have not used Interfaces earlier.I encountered this 3 line code used in my company application and was wondering if someone can explain me this. Thanks.
[code]...
View 3 Replies
Feb 22, 2011
The inline code
<% for (int i = 0; i < ThumbnailList.Items.Count; i++)
{ Response.Write("thumbnailViews[" + i.ToString() + "] = $find('" +
ThumbnailList.Items[i].FindControl("ThumbnailView").ClientID + "');
"); } %>
produces a bunch of compile time errors in Visual Studio 2008 - although it works fine.
But this seems to be the exact way inline code should be added, at least according to this MS help file:
[URL]
The errors are:
expected expression (at "<%")
expected ';' (at "int i")
expected ')' (at ThumbnailList.Items.Count;
expected ';' (at " i++)")
I have done a
<%@ Page Language="C#" ...
at the top of the file.
View 1 Replies
Sep 14, 2010
[Code]....
I've been moving lines around and going over and over this bit of code for ages and I can't work out what's wrong with it...
View 4 Replies
Dec 8, 2010
Any quick way to get a count on all the lines in a project?
That way you can use the info to try and convey the complexity of a project to a Customer.
Visual Studio 2010
View 1 Replies
Aug 24, 2010
I 'm gonna query database for photo records. each record include "photo path" where imagesURL stored in string format
I Choses my favorite Juqery plugin to show images. Plugin needs some lines of code like below.
How could I generate these lines
[Code]....
View 1 Replies
Mar 1, 2011
I want to store the following code into the database:
[Code]....
and then get it back in the dataset and display on a page.
As of now I have successfully stored the questions with varchar(MAX) datatype but when I try to get it in the dataset i get the following error:
Failed To Enable Constraints. One Or More Rows Contain Values Violating Non-null, Unique, Or Foreign-key Constraints.
I am doing this in a ASP.NET web application.
EDIT:
Here is the Table definition of the table I am inserting the data into
The query I am using to insert the data into the table:
[Code]....
And finally the code by which I am extracting the data from the dataset
[Code]....
View 2 Replies
May 20, 2010
I have an annoying problem with Visual Studio 2008.
When I run the "format code" command ("control+k, control+d") -- it will insert a carriage return. How do I get it to stop doing this?
For example:
<label for="shipCompanyName">Company Name:</label>
undesirably becomes
<label for="shipCompanyName">
Company Name:<label />
View 2 Replies
Jan 14, 2010
I'm currently trying to build a html table from the results of a sql data reader. As my table has multiple records, I want the code to loop through the reader and output the details on individual lines of the page. In ASP I have done this in the past using something like
[Code]....
but as I am using data readers I'm not sure what the equivalent is.
View 3 Replies
Apr 12, 2010
Following is the code to insert userName from session and PageName into table to keep record that how many times a user does hit a particular page.
To avoid repitition of code I want to put the code in one class and want to inherit same code in each page.
How to get this task? Please do share with me? Here is the OK code:
[Code]....
View 17 Replies
Jan 21, 2010
In the header text I need to get an output of two lines. The top one in Spanish an the lower one in english. Is there a way to break a line?
[Code]....
View 8 Replies
Jul 30, 2010
I've the Javascript code to do a confirmation before deletion of some records
function confirmDelete()
{
if(confirm('Delete all?'))
{
return true;
}
else
{
return false;
}
}
I've the button code here
<asp:Button ID="btnDelete" runat="server" onClientClick="return confirmDelete();" onClick="btnDelete_click" />
If i've the button outside an update panel (basically i'm using RadAjaxPanel by Telerik) it is working fine. But when the button is inside an ajax panel, even if i click OK for deleting the records the server side code is not called.
View 2 Replies
May 1, 2010
I'm missing a the code browser when I create pages that have the code not placed in a seperate file. For pages with .asp.vb files I get the browser correctly.
I think it's called a code browser but just in case it's not I mean the dropdown that shows Page Events, Buttons and other controls that can be selected along with their events.
How do I turn on those dropdowns for pages with code behind that uses <script> tags in the actual .aspx page?
Included (Showing page events just under the tab):
Missing
View 1 Replies
Mar 3, 2010
I want to call a function present in code behind from front page (html : source code)
i want to use like this:
Source code
<a href='<%# linkAlpha("B").ToString()) %>' title="B" id="B_List" runat = "server">B</a>
Code Behind
protected string linkAlpha(string value)
{
// /market-research/<%#Eval("customname")%>/
string str = "";
if (Request.Url.DnsSafeHost == "localhost")
{ // /market-reports/<%# Eval("customname")%>/
str = "Alpha_Category.aspx?q=" + value.ToString().Trim();
// Response.Redirect("Alpha_Category.aspx?q=" + value.ToString().Trim());
}
else
{
// str = "/market-reports/" + value.ToString().Trim() + "/";
str = "/Alpha_Category.aspx?q=" + value.ToString().Trim();
}
return str;
}
View 2 Replies
May 18, 2010
how do you call code behind button click event or a code behind method
from javascript.
View 8 Replies
Apr 16, 2010
Can the select command of a SqlDataSource be given by code in the code behind file. Also by calling the SqlDataSource.Select can the select statement be executed?
View 3 Replies
May 25, 2010
I have an asp.net button, that when clicked calls a code behind function. The function does some evaluation, and then I want to call javascript from within this asp.net function.
View 2 Replies
Dec 3, 2010
I want to bind an ObjectDataSource to a property in my asp page and I want to do it in the page's aspx code, not in code-behind. I've already done it in code-behind, as follows:
[Code]....
I'd prefer to get rid of the ugly code-behind and just do this in mark-up. Something like
[Code]....
This gives me a run-time error: Cannot create an object of type 'System.Object' from its string representation 'SelectedBook' for the 'DataSource' property.Is there a way of doing this declaratively and not in code-behind? Further, what if what I want is to actually use a child property of the property in question? For example, if my Book object has a ReaderComments collection, can I databind to it decaratively in the aspx mark-up?
View 1 Replies
Nov 12, 2010
anyone use/ know of any library or website with code snippets or samples with many of the mundane boilerplate code and/ or functions like data access, data scrubbing, recursive routines...
preferably c# since most of .net in the real world is c#. VB is ok too.
View 2 Replies
Jul 1, 2010
I have a number of radio buttons on my page. When one is selected, I wish for certain controls to be made visible/invisible.
Can anyone tell me the property to code in VB behind code?
View 5 Replies
Dec 30, 2010
how to generate HTML code from the code behind?
I would like to build a form that generate an html code inside a for loop.
I will let the user enter the photo name and No. of photos
Then I will generate an HTML code like this:
<a href="http://www.mzinj.org/images/gallery/Photo%20(1).jpg" target="_blank"> <img src="http://www.mzinj.org/images/gallery/Photo%20(1).jpg" alt="" width="345" height="247" /> </a> <br /> <a href="http://www.mzinj.org/images/gallery/Photo%20(2).jpg" target="_blank">
<img src="http://www.mzinj.org/images/gallery/Photo%20(2).jpg" alt="" width="345" height="247" /> </a> <br /> <a href="http://www.mzinj.org/images/gallery/Photo%20(3).jpg" target="_blank"> <img src="http://www.mzinj.org/images/gallery/Photo%20(3).jpg" alt=""
width="345" height="247" /> </a> <br />
depending on the No. of the photos the code will be duplicated in the loop
Then I will display the result of the loop in label or in a textarea to let the user copy it any where
The problem is that while compiling my code it considers the HTML code as a part of the behind file and gives errors on the single quote, the double quote and on the parentheses
View 4 Replies