September 11, 2010
@ 09:38 PM
adres çubuğunda www yazılıp yazılmadığını kontrol edin. yoksa www ekleyin.

if (Request.Url.Authority.StartsWith("www"))
return;


var url = string.Format("{0}://www.{1}{2}",
Request.Url.Scheme,

Request.Url.Authority,

Request.Url.PathAndQuery);


Response.Redirect(url, true);


 
Categories: ASP.NET | C# | Web

March 3, 2010
@ 05:36 PM

public static Image ResizeImage(Image imgToResize, int h, int w)

        {

            Size size = new Size(w, h);

            int sourceWidth = imgToResize.Width;

            int sourceHeight = imgToResize.Height;

 

            float nPercent = 0;

            float nPercentW = 0;

            float nPercentH = 0;

 

            nPercentW = ((float)size.Width / (float)sourceWidth);

            nPercentH = ((float)size.Height / (float)sourceHeight);

 

            if (nPercentH < nPercentW)

                nPercent = nPercentH;

            else

                nPercent = nPercentW;

 

            int destWidth = (int)(sourceWidth * nPercent);

            int destHeight = (int)(sourceHeight * nPercent);

 

            Bitmap b = new Bitmap(destWidth, destHeight);

            Graphics g = Graphics.FromImage((Image)b);

            g.InterpolationMode = InterpolationMode.HighQualityBicubic;

 

            g.DrawImage(imgToResize, 0, 0, destWidth, destHeight);

            g.Dispose();

 

            return (Image)b;

        }


 
Categories: C#

Eğer sayfanızda bir dropdownlist içine Ajax ile değerler doldurduysanız, sayfanızı postback yaptığınızda seçtiğiniz değeri
kaybedersiniz. S
udan çıkmış balık gibi olursunuz :)


Çözüm
C# ile

string strTown = Request.Form["ddlTown"];


Eğer MasterPage'den türemiş bir sayfanız var ise client tarafında yaratılmış dropdownlist kontrolün "name" attribute kısmını vereceksiniz.

string strTown = Request.Form["ctl00$ContentPlaceHolder1$ddlTown"];



 
Categories: ASP.NET | C#

Projenizdeki tüm cacheleri silin.

System.Collections.IDictionaryEnumerator dic = System.Web.HttpContext.Current.Cache.GetEnumerator();

            while (dic.MoveNext())

            {

                if (System.Web.HttpContext.Current.Cache[dic.Key.ToString()] != null)

                {

                    System.Web.HttpContext.Current.Cache.Remove(dic.Key.ToString());

                }

            }



 
Categories: ASP.NET | C#

February 7, 2009
@ 08:31 PM

Hitit emlak sitesini de faaliyete geçirdik.

Hayırlı uğurlu olsun :)

www.hititemlak.com


 
Categories: AJAX | ASP.NET | C# | Web

Zorlu gecelerden, Uzun uğraşlardan sonra nihayet projemizi; www.arabam.com yayına aldık. Vatana Millete Hayırlı olsun...


 
Categories: ASP.NET | C# | MVC | Web