Because
1 reason is that,,
YOU USED ‘ ‘ this quotation marks
dont use these.
ASP.NET & Csharp (C#) , Here you can find my posts about .NET c# .
Because
1 reason is that,,
YOU USED ‘ ‘ this quotation marks
dont use these.
1 |
API Reference > IWebmasterApi Members |
1 2 3 4 |
void SubmitUrl( string siteUrl, string url ) |
1 2 3 4 5 6 7 8 9 |
POST /webmaster/api.svc/pox/SubmitUrl?apikey=EEDECC1EA4AE341CC57365E075EBC8B6 HTTP/1.1 Content-Type: application/xml; charset=utf-8 Host: ssl.bing.com Content-Length: 127 <SubmitUrl xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api"> <siteUrl>http://example.com</siteUrl> <url>http://example.com/url1.html</url> </SubmitUrl> |
from : https://msdn.microsoft.com/en-us/library/jj554133.aspx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
namespace kutayzorlucom_webServeice_BING_API_EXAMPLE { using System; using System.Linq; using System.ServiceModel; internal class Program { private static void Main(string[] args) { var api = new WebmasterApi.WebmasterApiClient(); try { var oneMonthAgo = DateTime.Now.AddMonths(-1); var stats = api.GetRankAndTrafficStats("http://www.kutayzorlu.com/") .Where(s => s.Date > oneMonthAgo) .OrderBy(s => s.Date); Console.WriteLine("Date\tImpressions\tClicks"); foreach (var value in stats) { Console.WriteLine( value.Date.ToShortDateString()+", "+value.Impressions, value.Clicks); } } catch (FaultException<WebmasterApi.ApiFault> fault) { Console.WriteLine("Failed to add site: {0}", fault.Message); } } } } |
How to get API KEY (https://msdn.microsoft.com/en-us/library/hh969388.aspx)
1 2 3 4 5 6 7 8 9 |
Getting your API Key To be able to get your Webmaster API Key, follow the steps below: Sign into your Bing Webmaster account at http://www.bing.com/webmaster with your LiveID. If you do not already have a LiveID you can get one by clicking "Sign up with Windows LiveID” If you have no verified sites, please add and verify one. Then click on any site and select Webmaster API on the left hand side. Read the Terms and Conditions if not done so already Select on Generate to create an API Key. You only get 1 API key at a time |
The Bing Webmaster Tools API Services has the following protocols that can be used to get, call, submit, and retrieve data from Bing Webmaster to your website.
SOAP – Simple Object Access Protocol
Simple Object Access Protocol (“SOAP”) is a structure on which to exchange information with Extensible Markup Language (“XML”). Example of SOAP is that you could send a SOAP message to a website that has Web Services Enabled and receive information back from the website in XML that could then be used or implemented into a website.
POX/HTTP – Plain Old XML over HTTP
Plain Old XML (“POX”) is a term for basic XML and is an information format style. POX is compatible with the XML Schema. POX messages can be sent and received by many types of clients, including clients such as Web browsers that do not have any native support for SOAP-based protocols. POX is a suitable choice for services that exchange data over HTTP and have no requirement to use the advanced protocol capabilities of SOAP and WS-* such as non-HTTP transports, message exchange patterns other than request/response, and message-based security, reliability, and transactions.
JSON/HTTP – JavaScript Object Notation over HTTP
JavaScript Object Notation (“JSON”) is an imitated or copied from the JavaScript Language in order to provide simple data structures that can be text based.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
To enable custom errors in ASP.NET MVC application we need (IIS 7+): Configure custom pages in web config under system.web section: <customErrors mode="RemoteOnly" defaultRedirect="~/error"> <error statusCode="404" redirect="~/error/kutayzorlu404" /> <error statusCode="500" redirect="~/error" /> </customErrors> HttpContext.Current.Response.StatusCode = 500; HttpContext.Current.Response.TrySkipIisCustomErrors = true; <httpErrors errorMode="Detailed" /> |
1 2 3 4 5 6 7 8 9 10 |
Controller.cs // Index.aspx << View has ViewResult public ViewResult Index() { String asd= Request.Params.Get(0); int hour = DateTime.Now.Hour; ViewData["kutay_variable"] = (hour < 12 ? "morning" : "afternoon"); return View(); } |
Inside of View page,
1 2 3 |
<%=ViewData["kutay_variable"]%> >>> Out put is morning or afternoorn |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
* A model could be a single object or Arrays of objects or some structure of objects. Connection Data... * There should be a one-to-one correspondence between the model and its parts on the one hand, and the represented world as perceived by the owner of the model on the other hand. * For simple models using a table gateway/active record implementation may work. * Some Models isolates the database from the rest of your application. * You controller should process the request and pass whatever relevant data is needed to the model. * The model (or the data mapper) then uses the connection. * Model uses bootstraps or posted datas |
MVC is
M + V = C>> Controller is preparing Model then creating View.
In the Center there is a Controller
For Simple > Model = ‘ DATAS’
* The model is the data, and does nothing else.
Models (All of models in project ) does NOT depend on the controller or the view.
Controller Calling Model then pushing it to View. Controller is handling. But for the preparing the datas, controller does not effect how the model creating data sets, structs, objects.
Controller says model to that: Prepare user_table[array] ,
After pushing this object to View, View is using this table,
what is Controller ?
Such as button clicks. The controller depends on the view and the model.
Events.
The controller and the view are the same object. WHY > You can return a string as a page return “”
1 2 3 |
public string index2() { return "Index2 Return"; } |
What is the Advantage of model ?
Unnecessary complexity is the devil of software development.
Time loss for companies. . Complexity leads to software that is buggy, and expensive to maintain.
The easiest way to make code overly complex is to put dependencies everywhere.
* You can use model, Directly Copy paste inside of another Project. You can Call the Model from different Views, or Controllers.
>> Conversely, removing unnecessary dependencies makes delightful code that is less buggy and easier to maintain because it is reusable without modification.
* The primary advantage of the MVC is that makes model classes reusable without modification.
This view should be in “Shared Folder”
Otherwise it can give error , “The view or its master was not found or no view engine supports the searched locations”
1- Controller Name is important,
if you do not have the file inside of “view folder ” ,
it will look shared, . Firstly it is looking
>> “view folder/ControllerName/Filename”
==========================================================