|
I want a solution for validating weakly typed model.
not by using jquery validations,angular js, not by combining all the models to a single model
i want validation to to be done on .cshtml page
|
|
|
|
|
You can surely C# code on the (cshtml) page itself. But how do you want to add the validation? It is just a collection of simple conditional check ups?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I want to develop touch screen application in .C#.i didnt develop touch screen before.
|
|
|
|
|
|
touch screen application in C++
|
|
|
|
|
|
Read this[^], and pay particular attention to point 2.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
As Richard Deeming say to general. need to Be specific! All i can tell change your event to touch event 
|
|
|
|
|
Why are you telling me this? Did you mean to reply to the OP?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Do you have a question?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I am a sysadmin at the company I work for and I was encrypting connectionStrings in the web.config files of an IIS site in our Stage environment. I was using the instructions from here: Encrypt ConnectionString in Web.Config[^]
The developers deployed a new version of the site over the old one, did not alert me, and so I did not decrypt the web.config file.
Now we are getting error 500 each time we try and use the site.
1. Is it possible that ASP.NET on that server is expecting that web.config to be encrypted?
2. Do you need to decrypt web.config files before doing migrations of new web.config files into the same path, overwriting the old server?
3. Other than doing a restore from backup or having a copy of the encrypted web.config, is there any way to back out of it?
Thank you in advance!
Chris Wright
IIS SysAdmin
|
|
|
|
|
No, as pointed out in the article you reference, "it will run perfectly without any modification to your existing code." This means that the code is the same regardless if you encrypt the web.config or not.
I suggest looking in the event viewer because it does not seem like the encrypt/decrypt issue of web.config is the cause.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
That was my expectation, thank you for the confirmation.
|
|
|
|
|
Hi All,
I am maintaining a Web Application, when I am trying to Publish it I am getting the following error "A namespace cannot directly contain members such as fields or methods" and I am positive that C# won't allow me to have methods directly under a namespace without class.
The above error doesn't give me any information, hence I am researching online for help, please if anybody knows about this, can you please help me by a suggestion, a link or a code snippet. It helps me a lot.
Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
|
How do I save the values entering into textbox that is dynamically created to database
My Code
for (int i = 0; i < Grid.Rows.Count; i++) //Grid.Rows.Count
{
//TextBox CC = (TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA");
//TextBox CC1 = (TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA") as TextBox;
string StdMat = Grid.Rows[i].Cells[0].Text;
string CA = ((TextBox)Grid.Rows[i].Cells[2].FindControl("txtCA")).Text;
string UserID = Grid.Rows[i].Cells[1].Text;
Response.Write("CA= " + CC1 + "<br>");
MySqlCommand cmdd = new MySqlCommand("UPDATE resultstable2 SET CA=@ca WHERE student_ID=@student_ID", conn);// coursecode=@coursecode
cmdd.Parameters.AddWithValue("@ca", CA);
cmdd.Parameters.AddWithValue("@coursecode", cboCourseCode.Text);
cmdd.Parameters.AddWithValue("@student_ID", StdMat);
cmdd.ExecuteNonQuery();
}
-- modified 11-Jan-16 7:02am.
|
|
|
|
|
Where do you stuck. Error comes in which line number. or What is the error
hi
|
|
|
|
|
Hi,
I am using CodeSmith NetTier for DAL creation, can anybody give me idea how to use Stored Proc in NetTier and CodeSmith.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Dear Friends I am new MVC world & working in a project. I want to fill some html.editfor fields on a button click. My tried the given below codes:
Controller action:
[HttpPost]
public JsonResult GetRecordById(string id)
{
var record = dc.TABLE1.FirstOrDefault(x => x.PART_NO == id);
var result = new
{
Name = record.PARTI,
Type = record.TYPE
};
return Json(result, JsonRequestBehavior.AllowGet);
}
VIEW:
<script type="text/javascript">
$(function () {
$("#txtParti").autocomplete({
source: '@Url.Action("GetParti")'
});
});
$(function () {
$("#txtPtno").autocomplete({
source: '@Url.Action("GetPtno")'
});
});
$('#BTNFET').onclick(function (fetrec) {
var recordId = this.value;
$.post('@Url.Action("GetRecordById")',
{
"id": recordId
},
function (data) {
$("#txtParti").val(data.Name);
$("#Type").val(data.Type);
});
});
</script>
<input type="button" id="BTNFET" onclick="fetrec();" />
@Html.EditorFor(model => model.PARTI, new { htmlAttributes = new { @class = "form-control", @id = "txtParti", @placeholder = "PART NAME" } })
@Html.EditorFor(model => model.PART_NO, new { htmlAttributes = new { @class = "form-control", @id = "txtPtno", @placeholder = "PART NO" } })
@Html.EditorFor(model => model.TYPE, new { htmlAttributes = new { @class = "form-control", @id = "Type", @placeholder = "ITEM TYPE" } })
On the above codes Auto complete part working pefectly, Button click not working. So, friends please help me in this regard.
|
|
|
|
|
It looks like you have more of a JavaScript issue than anything else.
First, remove the onclick handler for the HTML tag, it's extraneous and basically binds a null event to the button I don't see a function fetrec defined anywhere, just an anonymous event handler.
<input type="button" id="BTNFET" value="@model.RecordId" /> <!--
Now for the JS. I'm not 100% sure about best practices with jQuery, and $.ajax() might be a better route, but we'll roll with what you have for the moment:
$('#BTNFET').onclick(function (e) {
$.post('@Url.Action("GetRecordById")',
{
"id": e.target.value
},
function (data) {
$("#txtParti").val(data.Name);
$("#Type").val(data.Type);
});
});
Now, in this context the 'this' object should be the event initiator, but that's not a guarantee. The handler will automatically be passed the event as an argument, though, and we can use that to hook the calling HTML element via the 'target' property. This has the benefit of not leaning on 'this' and therefore not needing to add a new variable into the mix.
|
|
|
|
|
|
Hi all..
I have to compare two text box values whether they are equal or less than or greater than like textbox1.text<=textbox2.text...
I am comparing date as string values..
Thanks in advance..
|
|
|
|
|
|
F-ES Sitecore wrote: to covert the string values in the textboxes into DateTime variables, and you can then compare the DateTime variables using ">>" "<" "==" etc. I would suggest using the
DateTime.Compare Method[^]
My name is Ozymandias, king of kings:
Look on my works, ye Mighty, and despair!
|
|
|
|
|
Why?
The operators[^] return the result of comparing the InternalTicks property for both instances.
The Compare method[^] does almost the same thing, but calculates and returns an integer (-1 , 0 or 1 ), which you then have to test to determine the result. (You also have to remember which value represents which result.)
What benefit do you see in using the Compare method over using the operators, when all you want to do is determine whether one value is less than another?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|