Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
O

ortaparmak

@ortaparmak
About
Posts
12
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Help with Headers Please Header.Controls.RemoveAt() Header.Controls.Add Dont Work...
    O ortaparmak

    Hello Everyone and thanks in advance for helping me with this. I need to programmatically locate and change the content of Description and Keyword metatags. Searching the internet, I have found a solution (not a solid one though) but it stopped working after I have changed the order of metatags (which I can understand). I have a masterpage site.master (with following code beside everything else as usual) where I set a default set of keywords and a default description (which are site-wide):

    <head id="Head1" runat="server">
    <title>My Default Page Title Here</title>
    <meta http-equiv="Content-Language" content="tr"/>
    <meta name="Description" content="My Default Description Here" />
    <meta name="Keywords" content="these, are, my default, keywords" />
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1254"/>
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta name="Rating" content="General" />
    <meta name="Author" content="Haluk " />
    <meta name="Copyright" content="www.acme.com.tr" />
    <meta name="revisit-after" content="1" />
    <meta name="robots" content="all" />
    <link href="styles.css" rel="stylesheet" type="text/css" />
    <link rel="SHORTCUT ICON" href="favicon.ico" />
    </head>

    and there are some asp pages (linked with site.master) where I want to be able to change Description and Keywords metatags for obvious SEO reasons. I placed following C# code in respective cs files:

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class akademik_indirim : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    this.Page.Header.Controls.RemoveAt(2);
    this.Page.Header.Controls.RemoveAt(2);
    HtmlMeta child = new HtmlMeta();
    child.Name = "Description";
    child.Content = "Custom Description for This Page";
    base.Master.Page.Header.Controls.Add(child);
    HtmlMeta meta2 = new HtmlMeta();
    meta2.Name = "Keywords";
    meta2.Content = "custom keywords, for, seo, purposes";
    base.Master.Page.Header.Controls.Add(meta2);

    ASP.NET csharp html css wpf com

  • Lost cs Files in ASP.NET Website.... Now I need to make additions.
    O ortaparmak

    I came back to thank you. Thanks to Reflector I recovered all the code from binaries and rebuilt the website in just 5 hours :D Thanks for pointing me to right direction. You saved me a lot of time. All the best.:thumbsup:

    C# question csharp asp-net visual-studio winforms

  • Lost cs Files in ASP.NET Website.... Now I need to make additions.
    O ortaparmak

    I checked ildasm already. It looked rather complicated and its been a few months since I coded this. So I guess I'll go with Refractor. Thank you for your time and valuable help. Kind Regards, Haluk

    C# question csharp asp-net visual-studio winforms

  • Lost cs Files in ASP.NET Website.... Now I need to make additions.
    O ortaparmak

    Thank you really. It seems a good solution in the long run (i.e. for recovering the entire website). But I still need a quick and dirty solution for adding a new user control to my published website...

    C# question csharp asp-net visual-studio winforms

  • Lost cs Files in ASP.NET Website.... Now I need to make additions.
    O ortaparmak

    Oh another thing, I don't want to put static HTML there. I want to put another user control that prints a random list of keywords (tag cloud) from a wide list of keywords... So static HTML is not the option.

    C# question csharp asp-net visual-studio winforms

  • Lost cs Files in ASP.NET Website.... Now I need to make additions.
    O ortaparmak

    Hello all, I have coded a quite-complex (for me) website that contains many controls and some loaded code-behind pages. I launched the website, no problems there. A few months after all files are gone in a harddisk crash. Now I have a fully functioning ASP.NET website at hosting company's computer, but no code behind files... As long as website works, noo problem I thought, I can work on it "someday" in the future. But now hosting company changed their configuration and one of the user controls that contained hard-coded directory path does not work anymore (oh yes I know I shouldn't have hardcoded and instead used settings files... But "it" happens)... I really don't have time to code all that stuff and code behind pages contained many SEO tweaks, I don't think I can get them all right in one go (last time it took mo more than 2 months to get it almost-right). I have temporarily solved the situation by removing the problematic user control. Now website works but that spot looks kinda empty and in a week or so I have to put there something and I don't really feel like coding the entire code behind pages. It took me 2 months to get together this babe... My question is this: Is there an easier way around? For instance, can't I just write a single replacement user control and have it compiled? When I tried it (on VS 2005) it tells me the website is already pre-built and refuses to build/publish the website. When I wrote a simple user control, inserted in site.master and clicked on Preview I can see it's working, but I can't publish/build. So I figure there should be a way... Any recommendations please? (P.S. I am a newbie and I am not a professional programmer; please take it easy on me :D) Thanks, Haluk

    C# question csharp asp-net visual-studio winforms

  • SQL Error converting data type varchar to numeric
    O ortaparmak

    Thank you. Much appreciated.

    C# database csharp help sql-server visual-studio

  • SQL Error converting data type varchar to numeric
    O ortaparmak

    Hogan Hi, Overriding ToString is not problem but... All calculations are made in the program; storing what is inappropriate for OS regional settings would complicate my calculations. In fact, changing the field type to string and storing Turkish notation decimal (i.e. 71,325) would be a workaround; but ideally there should be a real solution for this. Isn't there any localization settings in MS SQL server?!?

    C# database csharp help sql-server visual-studio

  • SQL Error converting data type varchar to numeric
    O ortaparmak

    Hello Rob, Thanks for helping me. You're right about all your comments. I have removed single quotes but this time I get another exception telling me there are more fields in VALUES than there is in INSERT. I checked what is sent to SQL, it is as follows: INSERT INTO Jobs (ProjectID, FileName, SourceLanguage, TargetLanguage, Type, CharCount, PageCount, ApplicableRate, QuotedOn) VALUES (34058, 'D:\UI\Projects\2007\34058 (Company)\Some Document.doc', 0, 1, 1, 71325, 71,325, 25, '05.11.2007 19:56:19'); SELECT SCOPE_IDENTITY(); As you can see 71.325 is written as 71,325 and I suspect SQL is translating this as 71 for one field and 325 for another field; thus there is more VALUES than INSERTs... PS: once I get this running, I'll optimize it and I took note of your comments about huge string and readibility

    C# database csharp help sql-server visual-studio

  • SQL Error converting data type varchar to numeric
    O ortaparmak

    Hello There, Here it is: INSERT INTO Jobs (ProjectID, FileName, SourceLanguage, TargetLanguage, Type, CharCount, PageCount, ApplicableRate, QuotedOn) VALUES (34058, 'D:\UI\Projects\2007\34058 (Company)\Sample Document.doc', 0, 1, 1, 71325, 71,325, 25, '05.11.2007 19:56:19'); SELECT SCOPE_IDENTITY(); It is right there, 71,325 is actually 71.325 in English (71325 / 1000). I suspect that is the cause of all this.

    C# database csharp help sql-server visual-studio

  • SQL Error converting data type varchar to numeric
    O ortaparmak

    Hello, I am a hobby programmer, writing a small office automation program for my office (translation agency). It's a small database application with several tables on MS SQL Server 2005 (Express). There is a Jobs table which includes individual Project items (i.e. when a translation project includes multiple language pairs, for instance XXXX_EN-TR and XXXX-DE-TR (where XXXX is ProjectID) these individual items (jobs) are written in Jobs table with a foreign key to Projects table's ProjectID). Upon a button click application should write to Jobs table with following: string addNewJobQuery = "INSERT INTO Jobs (ProjectID, FileName, SourceLanguage, TargetLanguage, Type, CharCount, PageCount, ApplicableRate, QuotedOn)" + " VALUES (\'" + projectID + "\', \'" + fileName + "\', \'" + srcLangID + "\', \'" + trgLangID + "\', \'" + typeID + "\', \'" + charCount + "\', \'" + pageCount + "\', \'" + applicableRate + "\', \'" + quotedOn + "\'); SELECT SCOPE_IDENTITY()"; Above string includes all mandatory (i.e. where null not allowed) fields of Jobs table and data submitted with this query is appropriate (i.e. decimal is sent to SQL for all decimal fields, Int64 sent for all long fields etc.). But it just don't work. It shoots me an exception "e.message = Error converting data type varchar to numeric." Following is a list of variables I sent in my last attempt: ProjectID = 34051 (valid, ProjectID should be long at SQL and Int64 in C# code) fileName = "D:\\UI\\...\\FileName.doc" (this is string in c# code and text at SQL; shouldn't be this one) srcLangID = 0 (bigint at SQL, Int64 in c#; this is foreignkey to LanguageID in Languages table; correct) trgLangID = 1 (biginy at SQL, Int64 in c#; this is foreignkey to LanguageID in Languages table; correct) typeID = 1 (SQL: bigint, C# Int64, correct - foreignkey to Services tables ServiceID, which is also long) charCount = 71325 (bigint at SQL, Int64 in C# code. this shouldn't be problem either) pageCount = 71.325 (decimal at SQL and decimal in C# code) applicableRate = 25 (alo decimal) quotedOn = 05.11.2007 17:40:15 (this I obtain with DateTime.Now; should not be problem UNLESS...) Here is what I seriously suspect; my OS is Turkish language, SQL Server Express is English, Visual Studio is also English. Could it be: 1) DateTime returning different format date/time (. instead of /); OR 2) Different decimal separators (. instead of ,) OH, wait, when I type above string (removing quotemarks and paranthesis ofcourse) in a query, it all works f

    C# database csharp help sql-server visual-studio

  • Adwords Bankruptcy Attack ?
    O ortaparmak

    Supposedly google has "statistical methods" to detect such a click-fraud... 3 years ago I begun advertising at adwords; it was fairly unknown in my Country in my business line. I paid 5 cents per click and closedly monitored it to ensure not to overspend. It worked charmes for about three months; paying a few hundred dollars I attracted many new customers. After that, I was billed two thousand dollars within just one week or so -before I noticed. I was sure someone kept clicking on my ad. Back than I used statcounter and their log files also supported my concerns. I complained Google. They asked my server lof files and stuff; and replied a week after telling me that all clicks were from unique users. Case was closed, but I was sure there was something wrong. I couldn't prove it off course. Anyway, about 6 months after I received a mail informing that there has been filed a class action lawsuit against Google with regards to click-frauds during the time I advertised and I was automatically included in class unles I explicitly waiver. According to that email Google spared a million USD to compensate the losses of advertisers who had been target to such fraud attacks Surely money had to be paid in advertising credits. I've been busy never had the time to check back. :D So yes, it was doable and yes, it must be still doable Haluk, www.ortaparmak.com

    The Lounge question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups