|
Hi,
Our website provide users with a forum where they can enter messages. So, typically, a user would enter a message, click submit, and their message would be displayed on the forum.
The db that stores these msgs uses a varchar field. Now, we're adding a facility to convert any urls that are entered to links by adding 'a href' tags, so that when users see messages with urls, those urls appear as links, and they can click on them. The problem is that if a user enters a message of 8K chars, then we add 'a href' tags to any urls they have, that makes the message length > 8K, preventing us from storing it in our db. (Please note that we do need to add HTML tags for other reasons as well, not just to convert urls to links.)
We thought about adding 'a href' tags during pre-render, thus avoiding storing html in the db, but found that doing such string manipulations, while a user is waiting to see their post displayed on the forum, was expensive. Timing tests revealed that the time to render such pages more than doubled.
I have solved such problems previously by adding an extra field in the db to store any overflow data, that is, data that appears after the first 8K chars.
However, I learnt of sql server 2005's varchar(max) datatype, and 'am wondering if the best way to solve this problem would be to replace the varchar field with varchar(max).
Thanks in advance for any advice.
Shefali
|
|
|
|
|
Either use nvarchar(max) or ntext
only two letters away from being an asset
|
|
|
|
|
I have a form with 2 fields, say "name" and "tel" of a person.
My visitors may need to add from 1 to n persons
I need to display only fields for 1 record and a button that adds omre records' fields on the runtime as visitors' needs
I can use javascript code to create html form fields on the fly
Is there any better idea using ASP.NET powerfull controls?
Mohamed Gouda
Egypt
|
|
|
|
|
Hi there. You are probably best off using javascript as it will give your visitors the best experience in their browsers.
You could do it server-side by dynamically adding the text box controls in your Page_Load - something like Placeholder1.Controls.Add(tb) but as a user, I'd prefer the javascript route to avoid the server postbacks.
|
|
|
|
|
You could use a GridView, adding an empty record each time the user clicks the Add button. Of course the new row would need to be in edit mode. Unless you use an AjaxPanel this will produce postback flashing of course.
only two letters away from being an asset
|
|
|
|
|
Another way is create a user control having the fields that you want to add after clicking (2 text boxex)
Now add a repeater to your page bind this user control to repeater
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hello
I develop a tool that display some charts,i used a charts control ,and a webchart.dll was added to my project ,when i run the project from visual studio i can see all the charts and the project is working well!
i also added the project to sharepoint web part.
the problem is when i viewing the site from another computer
this is the error i get
btw i develop before some webparts , this is the first time im using outside control...
HELP ME!!!
Required permissions cannot be acquired.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.
[PolicyException: Required permissions cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +2770052
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57
[FileLoadException: Could not load file or assembly 'WebChart, Version=1.1.1.4, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +54
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +211
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +141
System.Reflection.Assembly.Load(String assemblyString) +25
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +32
|
|
|
|
|
Hi everyone,
I am developing an asp.net webpage where i would like the user to play a game.
The game is moving a car for every time tick.
I got the timer function and made the movement in javascript.
Now my problem is that how to call the javascript function from my timer which i have in asp ajax.
Love to hear any advise.
Thanking you
|
|
|
|
|
I think you need to reverse your logic. The timer should be in the JavaScript, and it should make out of band calls to your page class, rather than you page class trying to communicate with the JavaScript.
only two letters away from being an asset
|
|
|
|
|
Hi Developers
I want my customers to chooose from different templates for there Ad page like: http://www.onestopmotors.com/ad_details.aspx?ad_id=7365[^].
Please let me know what is the best way to implement this concept(having multiple skins)? I know there are skin files in ASP.net 2.0 but I have to use ASP.net 1.1.
Thanks for your time
modified on Monday, January 28, 2008 12:28:18 PM
|
|
|
|
|
As you are using .Net 1.1, and don't have the option of theming, the easiest way would be to have multiple stylesheets, and use the QueryString variable to determine which stylesheet to link to.
In the <head> section of your aspx page, add a standard link element that links to your default CSS file. Give it an ID and mark it to runat="server" . In your code-behind file, make sure the link element is declared as type System.Web.UI.HtmlControls.HtmlLink along with the other page controls.
Then, when the page loads you can simply check the QueryString to see which stylesheet to use. If you have a valid stylesheet then simply set your declared link elements href property.
Hope this helps...
Clean code is the key to happiness.
|
|
|
|
|
I have a web application which connects to SQL Database to bring the data
I have set impersonation to true in the web config <identity impersonate="true" />
I have Integrated Security = SSPI in my connection string
I have set authentication mode= windows
I have set my IIS to use Integrated Windows Authentication.
Anonymous access turned off.
Am able to run it on server and it works fine. But when I try accessing from client machine,
Login Failed for user 'NT Authority\Anonymous LOGON' error.
Any idea? Please help.
Thanks
|
|
|
|
|
I have a gridview that is in a webpart, , one column is a checkbox column.
in the grid_row created event I set the proberties for the check box like so:
private void Grid_RowCreated(object sender, GridViewRowEventArgs args)<br />
{ TableCell cell;<br />
CheckBoxField column;<br />
CheckBox checkBox;<br />
if (args.Row.RowType == DataControlRowType.DataRow)<br />
{ for (int i = 0; i < args.Row.Cells.Count; i++)<br />
{ cell = args.Row.Cells[i];<br />
column = Grid.Columns[i] as CheckBoxField;<br />
<br />
if (column != null)<br />
{ foreach (System.Web.UI.Control ctl in cell.Controls)<br />
{ checkBox = ctl as CheckBox;<br />
if (checkBox != null)<br />
{ CaseCategory dataObj = args.Row.DataItem as CaseCategory;<br />
if (dataObj != null)<br />
{<br />
checkBox.ID = dataObj.CategoryId.ToString(System.Globalization.CultureInfo.InvariantCulture);<br />
}<br />
checkBox.AutoPostBack = true;<br />
checkBox.EnableViewState = true;<br />
checkBox.CheckedChanged +=new EventHandler(checkBox_CheckedChanged);<br />
checkBox.Enabled = true; <br />
} } } } } }
before converting this code worked perfectly, after the event does not get fired. I have removed the scriptmanager and related controls from the page, with no effect.
does anyone have any ideas what is going wrong, or how to fix it?
|
|
|
|
|
hi,
i installed visual studio .Net 2005.how i can work on the visual web developer ? and how i can open the ASP.NET Web application template?
when i click on new->web site then there are five templates show which are as ASP.NET Web Site,ASP.NET Service,Personal Web Site Starter Kit,Empty Web Site,ASP.NET CrystalReports Web Site.but there is no ASP.NET Web Application template how i can get it
|
|
|
|
|
|
thanks
I AM WORKING ON "PLOTTER ROBOT"(FYP).
|
|
|
|
|
Pls can anybody help me out on previewing image to be uploaded with
Fileupload. I have a javascript that loads the image in an image control
when fileupload is clicked, It works on IE 6 but on IE 7 the image is
not displayed
|
|
|
|
|
Hi,
Can you please post the code section that does not appear to be working, or give us an idea of how you are handling the image preview.
Thanx...
Clean code is the key to happiness.
|
|
|
|
|
Hello, I have created an ASP.NET web user control which has only one ImageButton. I have added 2 new properties to the class called OnMouseOverImage, OnMouseOutImage, these are both strings with getters and setters. Is it possible to make the designer open the file browser dialog when i click on these properties in the designer? Do I have to add some code, set some properties?..i don't know. I want them to behave like the PostbackURL or NavigateURL or ImageURL in the standard ASP classes for example. If this is possible, then please tell me how.
Uh...isn't there anybody who knows it? i didn't find anything about this problem.
modified on Tuesday, January 29, 2008 1:37:03 AM
|
|
|
|
|
Hi,
You should be able to accomplish this by marking your property with the required Editor attributes. By default all properties appear as straight text editable fields within the designer. By associating your property with an Editor that inherits from UITypeEditor, you should be able to achieve this. For example:
Reference the following namespaces within your class:
using System.ComponentModel;<br />
using System.Windows.Forms.Design;<br />
using System.Design;<br />
using System.Drawing.Design;
Mark your public property with the following:
Editor(typeof(FileNameEditor), typeof(UITypeEditor))
There are a number of pre-built editors that you could utilise so it may be worth having a play and seeing which works best.
Clean code is the key to happiness.
|
|
|
|
|
do you have to write something like this?
[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
public string PostbackURL
{
get
{
return ImageButton.PostBackUrl;
}
set
{
ImageButton.PostBackUrl = value;
}
}
It doesn't work, probably i'm doing something wrong.
modified on Wednesday, January 30, 2008 4:34:48 AM
|
|
|
|
|
I am developing a point-of-sales software on asp.net. When sending crystal
report to client browser for printing cash bill, browser always popup Acrobat Reader report viewer at client browser before bill can be printed.
Anyway for asp.net to send report directly to printer at client side? Too
many steps for cashier to get printed bills makes the system unfavorable.
):
|
|
|
|
|
ASP.NET works on the server and sends HTML to the browser. It don't have any access to the printer.
|
|
|
|
|
What about window.print()?
Thomas
|
|
|
|
|
thomas_joyee wrote: What about window.print()?
It's java script and won't send print command directly to printer. It will open the print dialog box.
|
|
|
|
|