|
please explain the simple understanding way to generate .dll file from asp.net project which contains only .aspx pages
|
|
|
|
|
|
When you compile or build the project all of the c# code gets put into a dll.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi,
I'm trying to POST values to a php service by HTTPWebRequest then It's returning true and inserting right values but when I'm doing it manually it is returning null.
Here is the Code:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.abc.com/showmydata/installinfo.php");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
string postData = "IMNumber=353323065370373&IPAddress=132.168.5.7";
byte[] bytes = Encoding.UTF8.GetBytes(postData);
request.ContentLength = bytes.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(bytes, 0, bytes.Length);
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream);
var result = reader.ReadToEnd();
stream.Dispose();
reader.Dispose();
It's working fine by this code but ,
when I'm doing it manually :
http://www.abc.com/showmydata/installinfo.php?IMNumber=353323065370373&IPAddress=132.168.5.7
It is returning both IMNumber and IPAddress null.
Please help me in this how manually is wrong and what is the pattern
of HttpWebRequest that returning it correctly.
Thanks!
|
|
|
|
|
When you do it manually you are sending a GET, not a POST. If the target service is coded to only work from POST then it thinks you have not sent it any parameters. To simulate a POST you'll need to use a tool like fiddler, or there are various add-ons for various browsers that will let you do this, things like "Postman" for Chrome.
|
|
|
|
|
How dll works after when only aspx file are present on the server
|
|
|
|
|
They don't. The files must be present in order to be accessed, and loaded into memory.
|
|
|
|
|
actually i lost my c# files, want to change some functionality, where can i edit the code.
|
|
|
|
|
You missed the point me think...OP asks about lost CS files, and those already compiled into the DLLs...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
The question was not exactly clear.
|
|
|
|
|
Exactly is an understatement...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
The code in the C# files (.aspx.cs) is compiled into the dll which is why you don't need them on the server.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Is there any way that i can edit code for adding functionality
|
|
|
|
|
You can edit the .aspx files if they are not compiled as well. But no, you can't edit the code because it is compiled into the dll.
Edit your source code and then publish again.
Alternatively, but not recommended, instead of doing a build and putting the dll on the server you can put all the source code on the server. Then you could make changes directly on the server.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
You'll need to reconstruct the source code from the compiled assemblies to get you back to a working solution again. There are various tools that can help you do this like ILspy, dotPeek etc.
|
|
|
|
|
who to developing net chat ,.use asp.net
|
|
|
|
|
|
|
So I'm working in this MVC project of mine which will be quite large. I went ahead and created a separate DLL for the Data Access Layer instead of including it in the MVC project.
Then I have all these custom programs, so I created another DLL and separated those programs I had in the App_Code folder to the new DLL. I also took all the SQL Linq statements and put them there as well. So all of the Service References, Business Logic is there now.
I have these Models like the example below.
public class AdminLoginModel
{
[Required]
[Display(Name = "Account Name")]
[PlaceHolder("Enter your account name")]
public string AccountName { get; set; }
[Required]
[DataType(DataType.Password)]
[Display(Name = "Password")]
[PlaceHolder("Enter your secure password")]
public string Password { get; set; }
public DateTime LoginDate { get; set; }
public string IPAddress { get; set; }
}
I understand that the stuff like Required are System.ComponentModel.DataAnnotations. And I was previously using the model above to send to the SQL Linq request to populate the date for the model.
So my question:
But do I have to? I'm still new to MVC, and I remember thinking oh how cool, I can just send the model and populate it, but now I don't want to do that anymore, and I can't remember how I was doing it in the beginning.
Are the DataAnnotations like a Razor thing? Or Validation Thing?
I'm trying to keep it clean this time, and don't want to dump it all together into one basket.
I want to store all the classes I use to project data in the common DLL, and perhaps storing these models there as well.
I was looking at the Owin or Identity example, and it seems that it stores the models in it's DLL and not in the MVC project, Which seems more straight forward to me.
I just wanted to check before I make more modifications that may not be good practice to do.
|
|
|
|
|
I figured out that I can place all my models in a separate DLL class, that I called Entities, and that I can just reference the namespace of models in the controller or view. And in the Models, I can just reference data annotations, and place interfaces in it like Placeholder and extensions like list helpers to populate dropdownlist.
So I was able to get all of my code out of the App_Data folder. And I guess I need the Razor to access Model collections in the view.
So I created 4 more project for my MVC app. Took awhile to figure it out, lots of experimenting as well. And I dumped the Owin Security Model and set it to false.
DataAccessLayer.Dll - My Data Access Layer Models and Seeds
Entities.Dll - My MVC Models, extensions and interfaces
Services.Dll - Service References to Web Services
Common.Dll - Encryption, Email Senders, and stuff
MVC Project.
|
|
|
|
|
Currently I am having one url with www.domainname/countrycode
1.at present my countrycode is default lets say Uk.
2.my requirment is according to my country location my url should append with countrycode.
Ex: if I type url from India ---> www.domainname.com/in
from UK --> www.domainname.com/uk
|
|
|
|
|
webforms or mvc? You have also posted this in the js forum so are you wanting a server-side solution or not? Don't spam the boards with multiple vague questions in the hope that something hits, be specific in what you're asking.
|
|
|
|
|
Hello
When it comes to a user who has forgotten his password while trying to log-on, for example, one way of him (not the administrator) resetting his password is to ask him to complete a field asking for his username or email, or both, and then sending him a link and 'token' to do so.
What is meant by 'token', please?
Thanks.
|
|
|
|
|
You could set a temporary password for the user, then set the password to expire immediately. This would allow the user to log into the system using the temporary password but would force him to change his password immediately.
In this case, the "token" would be the temporary password you have set for the user. The token is a randomly created string of letters and numbers.
|
|
|
|
|
Bad idea - now anyone who knows the username can lock the user out of their account by constantly requesting a temporary password.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|