Skip to main content

Posts

Recent posts

Delete put code

   <system.webServer>     <validation validateIntegratedModeConfiguration="false"/>     <modules runAllManagedModulesForAllRequests="true">         <remove name="WebDAVModule"/> <!-- ADD THIS -->     </modules>      <handlers>            <remove name="ExtensionlessUrlHandler-Integrated-4.0" />       <remove name="OPTIONSVerbHandler" />       <remove name="TRACEVerbHandler" />       <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />     </handlers></system.webServer>

Mycontext

 // MyContext.js import React, { createContext, useState, useContext } from 'react'; const MyContext = createContext(); export const MyProvider = ({ children }) => {   const [myState, setMyState] = useState('Initial Value');   const updateState = (newState) => {     setMyState(newState);   };   return (     <MyContext.Provider value={{ myState, updateState }}>       {children}     </MyContext.Provider>   ); }; export const useMyContext = () => {   return useContext(MyContext); };

Asp.webconfig Api Delete post put get all allwo

 <?xml version="1.0" encoding="utf-8"?> <!--   For more information on how to configure your ASP.NET application, please visit   http://go.microsoft.com/fwlink/?LinkId=301879   --> <configuration>   <configSections>        <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->   <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />   </configSections>   <connectionStrings>     <add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-chatapi-20230925125315.mdf;Initial Catalog=aspnet-chatapi-20230925125315;Integrated Security=True" providerName="System.Data.SqlClient" />  

404 react js after public

react js   <system.webServer>     <httpErrors errorMode="Custom" existingResponse="Replace">         <remove statusCode="404" subStatusCode="-1" />         <error statusCode="404" path="/" responseMode="ExecuteURL" />     </httpErrors>   </system.webServer>

Log time Cookis asp.net

  HttpCookie Cookie = new HttpCookie("Client");                 Cookie["ID"] = ds.Tables[0].Rows[0]["UserName"].ToString(); ;                 Cookie.Expires=DateTime.Now.AddYears(2);                 Response.Cookies.Add(Cookie);