Hi, i'm trying to make my website more secure by encoding any output i display. However i still want to allow some html tags.
I am using a wysiwyg editor with only bold, italic and underline enabled. I enter my text in the wysiwyg and click submit, the data is then inserted into the database...
Hi, i'm trying to create my own pager control. I've built very basic web controls in the past but this one is the first where i have had to handle events. So far i have:
public class PagerCommandEventArgs : CommandEventArgs
{
public int Page { get; set; }
public...
Hi, i've always taken security for granted in my websites but i am currently in the process of building a big website where security is of major importance. I understand most of the server side security concerns such as sql injection but with javascript (and ajax) i get a little bit lost. From...
Hi, I'm trying to make my site more search engine friendly by correctly handling 404 error pages. I have the following in my web.config file:
<customErrors mode="RemoteOnly" defaultRedirect="~/Error/500.htm">
<error statusCode="500" redirect="~/Error/500.htm"/>
<error statusCode="404"...
Hi, i can't seem to use databinding syntax within the LayoutTemplate of the ListView control. I have tried:
<%# SomeProperty %>
but this does not work. In the past i was able to do this fine within the HeaderTemplate of a Repeater control. I modified the above to:
<%= SomeProperty %>
but...
Hi i have the following code within a user control to build a table:
protected int RowCounter
{
get
{
object o = this.ViewState["RowCounter"];
return o != null ? (int)o : 0;
}
set
{
this.ViewState["RowCounter"] = value;
}
}
protected void...
Hi, I have a couple functions to return the position of a tag. I'm hoping i can then use this to position an absolute positioned tag on top of this tag. However since this returns the position from the edge of the browser, if i have a parent element which has relative positioning the element...
Hi, maybe i'm just being picky/lazy but i'm trying to set the PageSize of my DataPager (which sits within the LayoutTemplate of my ListView). I tried doing:
PageSize="<%# Globals.Settings.Content.News.MaximumRows %>"
and i received no errors but it simply ignored it. I thought the...
Hi, i'm trying to use the DataPager control and i have two problems:
1. It uses the the physical url and not actual url, ie default.aspx instead of default.htm (i use isapi rewrite to rewrite the url)
2. I can't see how i can customize the way the paging works. I can see there is a...
Hi, i haven't been programming in c# for long and was wondering how i could rewrite the code below to be alot nice:
int width = 100;
int height = 130;
float ratio = (float)image.Width / (float)image.Height;
if ((float)width / (float)height > ratio)
width = (int)Math.Round((float)height *...
Hi, my database has the following tables:
Sections:
- SectionID (PK)
- SectionName
Documents:
- DocumentID (PK)
- SectionID (FK)
- Title
Attributes:
- AttributeID (PK)
- SectionID (FK)
- AttributeName
My site is split into sections ie News, Events etc (stored in the sections table). Each...
Hi, i am building a website which requires my users to upload lots of images. I feel this could clog up the server in terms of bandwidth and space.
I was wondering if i could use a third party website to upload my images too via a developer api. However i don't have much experience in this...
Hi, i have the following tables:-
NewsArticles (for my news section):
- ArticleID (PK)
- Message
...
Products (for my products section):
- ProductID (PK)
- Title
...
I need to add a comments facility to both my news and products sections. I don't wish to create seperate tables for each as i...
Hi i have a user defined function (called IsValid) which has one parameter and returns a bit. I need to create a sql statement which returns any rows in a table where the function returns 1 based on the inputted value, ie
SELECT * FROM Groups WHERE dbo.IsValid(GroupID) = 1
But the above does...
Hi, i have a fantasy manager site with football players. The players are stored in the following table:
players:
- player_id
- transfer_player_id (if not 0 then then the player has been transferred)
- date_created (date the player was added)
Every week i run a script which runs through all...
Hi, i have created my own custom repeater which inherits from the standard repeater and the only difference is that it contains an EmptyDataTemplate.
public class Repeater : System.Web.UI.WebControls.Repeater
{
private ITemplate _emptyDataTemplate;
[Browsable(false)]...
Hi i have a nested control i need to call in about 6 different methods. Therefore at the top of every method i have:
ListBox lbxLeftColumnAdverts = (ListBox)fvwDocument.FindControl("lbxLeftColumnAdverts");
Is it not possible to add a private variable to access this control. I tried placing...
Hi, i'm having some problems updating cookies. I have the following code when a user submits a comment:
Response.Cookies["Comment"]["FullName"] = txtFullName.Text;
Response.Cookies["Comment"]["Email"] = txtEmail.Text;
Response.Cookies["Comment"]["Url"] = txtUrl.Text...
Hi, i'm trying to add no data template to the repeater control. I am following the article at:
http://weblogs.asp.net/acampbell/archive/2004/06/19/159780.aspx
Basically i add a property to the repeater:
[Browsable(false)]
[PersistenceMode(PersistenceMode.InnerProperty)]
public ITemplate...
Hi, i'm trying to build my own pager control. I have added a property called DataSourceID which allows me to access the ObjectDataSource on the page. However in my control i need to call the "SelectCountMethod" from the type "TypeName" specified by the object data source to return the number...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.