|
HOW TO WRITE CODE FOR SELECT MULTIPLE PRODUCTS AT A TIME IN E-COMMERCE WEB APPLICATION BY USING CHECK BOX OR RADIO BUTTONS.
10570172
|
|
|
|
|
|
|
how can I declare Public Enum with strings?
Public Class ImplementationHelper
Public Enum ExcelSheetName
"High Level Benefits"
"Benefits"
End Enum
|
|
|
|
|
You can't. What exactly are you trying to do? Perhaps use Strings in a static class instead.
If these are Excel sheet names you can always do ExcelSheetName.Benefits.ToString() to get the actual string value.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I am trying to declare string which I can use in the project
|
|
|
|
|
You can use CONST
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
well I kind of want to separate... any other suggestion's?
|
|
|
|
|
A class with CONSTS. A resources file. Are you going to be doing tons of them?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
They use classes instead of enums.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi ,
How to implement Facebook like notification in website using asp.net FrameWork 2.0
SignalR can not be used because my website built in 2.0
I want to show only Update Notification Count.
my plan is to use JavaScript setTimeout() function in which I will call ajax .
but I am worried about is Load on Browser and DB server.
please suggest me best solution for this scenario
|
|
|
|
|
jeevanjoshi wrote: please suggest me best solution for this scenario Of course there is no such things as a "best" solution. However, if you are unable to use existing libraries, such as SignalR, then you need to use the manual approach which means doing it in JavaScript as you mentioned.
If you can do jQuery that should help you a lot.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi RyanDev
Thanks for your reply.
I am only worried about load on browser and DB
modified 17-Oct-14 1:29am.
|
|
|
|
|
jeevanjoshi wrote: I am only worried about load on browser and DB Typically, your code won't change much as long as you write good code to begin with. Handling an increase in load is done by configuring servers, not changing code.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
|
Hi all,
I am very new to ASP.net MVC.
I am creating a simple web application and want capture and save the userID to a newly created record by the user.
The reason is, I want users only can edit the records they created if not their record then only can view (except for the admin ofcourse).
modified 16-Oct-14 8:41am.
|
|
|
|
|
It is not clear what is the question.
I beleive getting the current username inside a controller can be done like this:
Username = User.Identity.Name
|
|
|
|
|
Thanks so much for the respond.
Part 1. Get the user ID.
Part 2. Write the user ID to the Database (server side)
So, Username = User.Identity.Name is to get the user ID.
Now how do I write the user ID to the table (the database).
|
|
|
|
|
I'm really not that familiar with MVC development, but I believe the SQL necessary to store the UserID would be in a "Model".
|
|
|
|
|
Does anyone have a sample code for me to write UserId to the table (database server side)?
Help.....I stuck
|
|
|
|
|
I want validation code in separate js file and include it on content page in asp.net
How can I use controls on content page with js file ?
Please provide solution with custom example.
|
|
|
|
|
Your question contradicts the title
Your should probably use jquery first
So you right click on solution exploer, add file JScript, and name it validate.js
Then create a function
function validate_text() {
var vFlag = true;
var txtFocus = 'rgb(255,255,255)';
var txtError = 'rgb(255,0,0)';
var message_value = $('[id*="_txt_CRM_VCM_MessageReply_Field"]').val();
if (message_value.length < 2) {
$('[id*="_txt_CRM_VCM_MessageReply_Field"]').css('border', 'solid 1px ' + txtError);
vFlag = false;
}
else {
$('[id*="_txt_CRM_VCM_MessageReply_Field"]').css('border', 'none');
}
return vFlag;
}
On your Button, program the OnClientClick property
<asp:TextBox ID="_txt_CRM_VCM_MessageReply_Field" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return validate_text(); " />
Now drop in your jquery, this will dowmload jquery to the page for use in your validate.js
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
or download jquery and create a jquery.js file where you placed your validate.js file
Make a reference to validate.js
Use the solution explorer and drag the file to within the head tags, and the script tag will automatically be formed.
|
|
|
|
|
I have a page like this:
<%@ Page Title="test" Language="C#" MasterPageFile="~/Template.master" CodeFile="Define.aspx.cs" Inherits="JobRecords_Default" EnableEventValidation="false"%>
<script type="text/javascript">
function changeFunc() {
var selectBox = document.getElementById("selectBox");
var selectedValue = selectBox.options[selectBox.selectedIndex].value;
window.location.href = '?s=' + selectedValue;
}
</script>
<form role="form">
<label>Ward:</label>
<select id="selectBox" class="form-control" onchange="changeFunc();" runat="server">
<option value="1">Ward 1</option>
<option value="2">Ward 2</option>
<option value="3">Ward 3</option>
</select>
<asp:Button ID="btnRegister" CssClass="btn btn-lg btn-block btn-success" runat="server" Text="Register" OnClick="btnRegister_Click" ></asp:Button>
</form>
I want to use
changeFunc() in my selectBox onchange event
If in the first line I set EnableEventValidation to false changeFunc() wont fire and if I set EnableEventValidation to true after clicking the btnRegister I will see below error:
Quote: Invalid postback or callback argument. Event validation is enabled using <pages enableeventvalidation="true"> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
is there any one who can help???
|
|
|
|
|
True!
The problem is that you do not initiate post-back but change location...That makes ASP.NET engine think that you are not you!
The best you can do is to use DropDownList[^] control of ASP.NET...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|