I'm need to run my old project using ASP.NET webform with .NetFramework 3.5
So. I'm facing with problem missing ajaxpro javascript file (error 404) when I run test
Here is code I register Ajaxpro class
public partial class WebPage_Event_Event : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
pmSetClientAttributesControls();
}
}
private void pmSetClientAttributesControls()
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(WebPage_Event_Event));
}
[AjaxPro.AjaxMethod]
public bool Ajax_pmChkTimeOut()
{
return System.Web.HttpContext.Current.Session["Login"] == null;
}
}
So. when I run on IIS express in VS2022 I found this error
Any one know how to fixed this
Thank you.
Related
I have a winform app, I completed with business model and update function. But when I learn about security .Net, I found that almost impossible to anti crack/hacking with obfuscation.
So I want move 99.99% source code to cloud. But I've not found any doc that useful for making it.
Can I do my idea as below:
using ....;
namespace myApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public GetSourceClass()
{
// Here i want get all source code, include all class and all
// variables from server.Is it possible?
}
private void Form1_Load(object sender, EventArgs e)
{
GetSourceClass();
}
I m using Unis 3.1.1 with Virdi Ac7000 and gathered all employees fingerprints on one device and when trying to distribute users data all over other devices all emp data is transfered very well except the fingerprint
I tried on Access DB and Oracle and the same problem
is there any conf. has to be done or this is a bug in UNIS
I downloaded the VIRDI SDK from
https://drive.google.com/folderview?id=0B06Dxl8hzdKDZllHYlloU3lZbUk&usp=sharing
and tried to run the server within visual studio but also gave me 1002 error and didn't start although the example UCSAPI_Demo.exe in runs very well
using System.Windows.Forms;
using UCSAPICOMLib;
using UCBioBSPCOMLib;
namespace UCSAPI_DemoCSharp
{
public partial class test : Form
{
public UCSAPICOMLib.UCSAPI ucsAPI;
public UCSAPI m_Api = new UCSAPI();
public test()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
m_Api.ServerStart(999, 9870);
MessageBox.Show(m_Api.ErrorCode.ToString("X4"));
}
private void test_Load(object sender, EventArgs e)
{
}
}
}
This error is related to the dlls, your application is not accessing it well.
Pls, try putting all the VIRDI dlls, in the same folder of your application.
I prepared a very simple Web site to demonstrate this behavior.
It has one page with one Button and the following code:
public partial class TestStatic : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Class1.SetValue();
Label1.Text = Class1.st.ToString();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = Class1.st.ToString();
}
}
and one class:
public class Class1
{
public Class1()
{
}
public static int st = 0;
public static void SetValue()
{
st = 1;
}
}
So when the page is loaded you see in Label1 that st=1. If user clicks on the Buttton that sometimes you can see st=0 and sometimes st=1. In debugging I see that sometimes command
public static int st = 0;
is executed when an user clicks on the Button and this is a reason why st is changed to zero. This behavior I can reproduce in framework 4.5 only: it does not occur in framework 3.5. Can somebody explain me such behavior?
Static data lives per application domain instance. Since the hosting (IIS) can unload application domains between web site calls, static data can be lost.
So, you really shouldn't rely on static in web apps.
static values are shared across all instances of a class inside of a single App Domain.
If you're using IIS Express, your appdomain may be getting recycled more often than you think it is.
reference this: Lifetime of ASP.NET Static Variable
I have a custom HttpModule implemented for a site I am working on. It is designed to perform an action on the PreSendRequestContent event. When I run the debugger and built in Visual Studio Server it runs without any problems. BUt when I publish it to the Live Server it doesn't. I am using a Classic Mode configuration of IIS meaning that I should only have to add the module to the web.config file. Am I missing something?
namespace SmartBilling
{
public class HttpModule : IHttpModule
{
public HttpModule()
{
}
public void Init(HttpApplication httpApplication)
{
// Register our event handler with Application object.
httpApplication.PreSendRequestContent += new EventHandler(httpApplication_PreSendRequestContent);
}
void httpApplication_PreSendRequestContent(object sender, EventArgs e)
{
// Do stuff
}
public void Dispose()
{
// Left blank because we dont have to do anything.
}
}
}
I have the following class...
public class MyCustomLogger
{
public static int DEFAULT_INFO = 0;
public static int DEFAULT_LOGIN = 1;
//etc
public static void Log( ... )
{
doStuff(...);
}
public static void Log( ... , ... )
{
doStuff(...);
}
private static void doStuff(...)
{
//doLots of Stuff
}
So when I call MyCustomLogger.Log(...); from another Custom Class... it works fine. No compile errors...nothing. It just works
When I call it from SuchAndSuch.master code behind... it works fine. No Compile errors...nothing. It just works.
When I call it from SuchAndSuch.ascx code behind... it works fine. No Compile errors...nothing. It just works.
However... when I call it from SuchAndSuch.aspx code behind... it doesn't work. I'm getting 'MyCustomLogger' does not contain a definition for 'Log'
I'm getting this from any aspx page I add it to.
EDIT
Here's a snippet from the aspx pages i'm trying to add it to
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Logout : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//doStuff
}
protected void Button1_Click(object sender, EventArgs e)
{
MyCustomLogger.Log(MyCustomLogger.DEFAULT_INFO);
Has anyone else experienced this?
Here are a few ideas on what might be causing this:
If this is a web site project, which I'm guessing because your extract does not include a namespace, do you have another class in your app_code folder with the MyCustomLogger name?
If this page is in the Master Page, is the Master Page exposing something named MyCustomLogger as a public property and conflicting with the app_code definition?
If this is a web application project, the problem could be because the Namespace declaration is missing on the page.
Is there another type in the page that's MyCustomLogger that there is a conflict (can't resolve the correct type? Can you post any code to help us see the issue?