|
|
Quote: Hi ,
Can i get the code base or some url for develop the extra level of security using a SMS service into my application and need to develop in Visual Studio 2005.(One Time Password two-factor authentication)
Example - After login into the application via general login procedure after that we need to add the extra level of security using a SMS service for user and we will send the password to user on user mobile.
It is very very urgent.
Regards,
Bharat
|
|
|
|
|
You'll need to write your own code or find some samples online and adjust to fit your needs.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thanks RyanDev,
yes, we need to write the own code but i am looking some sample code only which i can adjust for my needs. if you find some sample code link or anything else. please help me here.
thanks in advance.
Regards,
Bharat
|
|
|
|
|
Just google C# sms. There are tons of examples.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Unable to use any Actions from Pages in Navigation Bar if Arabic language is set.
Steps to reproduce:
1. Log in as Host to 7.3.4 latest build
2. Localize site with Arabic (Saudi Arabia), en-Us languages
3. Click the Arabic flag to switch to ar-SA (Saudi Arabia) language
4. Hover over Edit Pages in the Navigation Bar
5. Click "Add a NEW PAGE"
The Create Page pop up starts to render
It disappears
In the UI I get an error message:
A critical error has occurred. Please check the Event Viewer for further details.
Error:
AssemblyVersion:7.3.4
PortalID:0
PortalName:project india
UserID:1
UserName:admin
ActiveTabID:74
ActiveTabName:Log Viewer
RawURL:/ar-om/Admin/Log-Viewer/ctl/Tab/activeTab/settingTab?popUp=true
AbsoluteURL:/Default.aspx
AbsoluteURLReferrer:http://umstest.com/ar-om/Admin/Log-Viewer
UserAgent:Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:3ed97128-f4cc-49b7-9a9b-5b4ba5be3abb
InnerException:Valid values are between 1318 and 1500, inclusive. Parameter name: year
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:System.Globalization.UmAlQuraCalendar.CheckYearRange
RajeeshMenoth
|
|
|
|
|
RajeeshMenoth wrote: InnerException:Valid values are between 1318 and 1500, inclusive. Parameter name: year Seems fairly clear.
|
|
|
|
|
How to solve this error ?
|
|
|
|
|
|
Where we can add this year number ?
|
|
|
|
|
No idea, since you have not given us any information about your code or where the error is occurring.
|
|
|
|
|
I got the error this way :
Unable to use any Actions from Pages in Navigation Bar if Arabic language is set.
Steps to reproduce:
1. Log in as Host to 7.3.4 latest build
2. Localize site with Arabic (Saudi Arabia), en-Us languages
3. Click the Arabic flag to switch to ar-SA (Saudi Arabia) language
4. Hover over Edit Pages in the Navigation Bar
5. Click "Add a NEW PAGE"
The Create Page pop up starts to render
It disappears
In the UI I get an error message:
A critical error has occurred.
|
|
|
|
|
|
Hi experts,
I am not sure whether to post this on JavaScript forum or here. Please forgive me if I posted at the wrong forum.
I have a javascript that calculates the different between start time and end time.
The value of the difference is stored in a variable called hourDiff.
var hourDiff = endDate - startDate;
Below, I am passing some form variables from one page to another page called Reserve.aspx using asp.net.
Code is below:
<asp:HyperLink ID="siteId" style="color:#111" runat="server" navigateurl='<%# String.Format("Reserve.aspx?id={0}&groupsize={1}&facilityFees={2}&extrahour={3}&depoitAmt={4}&cancelAmt={5}&keydeptAmt={6}", Eval("siteId"), Eval("capacity"),Eval("RentalFeeAmount"),Eval("ExtraHourAmount"),Eval("DepositAmount"),Eval("CancellationAmount"),Eval("KeyDepositAmount")) %>' Text='Select' />
Is it possible to pass this javascript variable as part of the hyperlink?
If no, is there another way to do this?
Basically, assuming that acceptable hour difference is 2, anything above 2 incurs additional fees.
So, I wanted to pass that variable to Reserve.aspx page so I can substract 2 from whatever the total hourDiff is and if the difference is greater than 0 than add x amount of additional charges to the total hours greater than 2.
Your help is greatly appreciated.
|
|
|
|
|
|
Dear just do two simple steps:
1. First hourDiffvalue into a hidden field.
2. Then Pass the hidden field value to hyperlink as
<asp:HyperLink ID="siteId" style="color:#111" runat="server" navigateurl='<%# String.Format("Reserve.aspx?id="+<b>HiddenField1.Value</b>+"&groupsize={1}&facilityFees={2}&extrahour={3}&depoitAmt={4}&cancelAmt={5}&keydeptAmt={6}", Eval("siteId"), Eval("capacity"),Eval("RentalFeeAmount"),Eval("ExtraHourAmount"),Eval("DepositAmount"),Eval("CancellationAmount"),Eval("KeyDepositAmount")) %>' Text='Select' />
|
|
|
|
|
I used that starter project to create my first website. I'm done with the contollers and views, I made my HTML pages, and wanted to modify the register user program. So I made my textboxes, modified the AccountModel for it, and ran into a road block. The logic or the code in compiled is in a DLL, or I guess called a plugin or package.
This is what I wanted to modify, add some fields like Company Name and Email Address
F:\packages\Microsoft.AspNet.WebPages.WebData.3.2.3\lib\net45\WebMatrix.WebData.dll
WebSecurity.CreateUserAndAccount(model.UserName, model.Password);
So this is a pre-fabricated dll from NuGet, in which the source code is kept safe for?
And I have to write my own gig in order to do this?
So my question is:
If I want to start writing my own stuff here for my MVC Project, I have to create a new project, and compile it as a DLL, and add a reference to it, or write something in the App_Code folder to experiment with?
Not quite sure how to precede here. I searched around and couldn't figure out the keywords of what to look for.
|
|
|
|
|
I just got schooled in Simple Membership and the WebMatrix DLL
When I saw how much code was in the DLL, I decided not to touch it.
So then I started thinking, I can't be the only one that wants to modify it, so I used keywords for modifying SimpleMembership.
It took a couple of tries, but now I got it, well at least the database was created. Now I need to test the Register part.
I used answer 2, the non destructive method.
http://stackoverflow.com/questions/12435252/how-to-create-custom-additional-fields-in-userprofile-in-mvc4[^]
|
|
|
|
|
Not sure if I did this right, but I had to get the Register working.
So I modified the ActionResult register
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public ActionResult Register(RegisterModel model)
{
if (ModelState.IsValid)
{
try
{
WebSecurity.CreateUserAndAccount(model.UserName, model.Password);
int userID = WebSecurity.GetUserId(model.UserName);
bool s = WebSecurityExtender.UpdateUserAndAccount(userID, model.Name, model.CompanyName, model.EmailAddress);
WebSecurity.Login(model.UserName, model.Password);
return RedirectToAction("Index", "Home");
}
catch (MembershipCreateUserException e)
{
ModelState.AddModelError("", ErrorCodeToString(e.StatusCode));
}
}
return View(model);
}
And wrote sort of an extender in App_Code
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
namespace WebMatrix.WebData
{
public class WebSecurityExtender
{
public static bool UpdateUserAndAccount(int userID, string name, string companyName, string emailAddress)
{
bool success = false;
string connStr = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
SqlConnection conn = new SqlConnection(connStr);
string query =
"UPDATE " +
" UserProfile " +
"SET " +
" Name = @Name " +
" ,CompanyName = @CompanyName " +
" ,EmailAddress = @EmailAddress " +
" WHERE UserID = @UserID ";
SqlCommand cmd = new SqlCommand(query, conn);
cmd.Parameters.Add(new SqlParameter("@UserID", userID));
cmd.Parameters.Add(new SqlParameter("@Name", name));
cmd.Parameters.Add(new SqlParameter("@CompanyName", companyName));
cmd.Parameters.Add(new SqlParameter("@EmailAddress", emailAddress));
try
{
conn.Open();
cmd.BeginExecuteNonQuery();
}
finally
{
conn.Close();
}
return success;
}
}
}
This is my first time working with MVC and C-Sharpe, and I know I could of done better in the database call, but I really had nothing to go on here. I need to add the catch as well.
|
|
|
|
|
I my webform asp.net project, I use web api controller to access the server data.
I use framework 4.5.
On localhost everything works, but when I publish to server I get 404 for http://www.mydomain.it/api/fileupload/UlpoadFileMat.
This is the code in file global.asax
<pre lang="xml">
protected void Application_Start(object sender, EventArgs e)
{
GlobalConfiguration.Configure(config =&amp;gt;
{
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: &amp;quot;DefaultApi&amp;quot;,
routeTemplate: &amp;quot;api/{controller}/{action}/{id}&amp;quot;,
defaults: new { id = RouteParameter.Optional }
);
});
}
On the server the framework 4.5 is installed.
In IIS, in application pool, I've set the correct framework version.
What is the problem?
What are the server requirements? What should I install?
Thanks
|
|
|
|
|
I have a ASP.Net 3.5 web application with SQL 2008 as the back-end. I used ADO.Net's enterprise library Data Helper classes (Entlib 4.1) to access the DB and its stored procedures.
I initially set the CONTEXT_INFO in a stored procedure and then in subsequent stored procedures, I use the value set in CONTEXT_INFO to filter the queries. It worked perfectly in this setup.
I then migrated to ASP.NET 4.5.1 framework with EntLib 6 (tried with 5 also). I am facing a fundamental issue in that the CONTEXT_INFO value is not being retained between 2 subsequent SP calls. I have not closed the connection between calling the SP's/subsequent calls. Therefore none of my SP's return values.
SP for setting CONTEXT_INFO
----------------------------
DECLARE @ContextInfo varbinary(128)
SELECT @ContextInfo = cast( @SomeIDPassed AS varbinary(128) )
SET CONTEXT_INFO @ContextInfo
Other SP using CONTEXT_INFO
---------------------------
(CONVERT(int, RTRIM(REPLACE(CONVERT(varchar(128), CONTEXT_INFO()),char(0), '')))))
Please provide your inputs
Thanks,
Anand
|
|
|
|
|
I'm trying to figure out how to create a link to download one of my windows apps.
I'm new at this, HTML5, CSS3, MVC and c# all at the same time.
So in my view, I wrote this. If the user is logged in, they can download the file, and vice versus. It seems to work fine, not sure if I did it the right way or not.
<h5>How to get Streakwave Reseller 2015 today</h5>
<p>
Simply register an account, so we can get an idea if folks are using it, and click on
Installation takes about 30 minutes, including the download of LocalDB, and the <br />
Currently the program is shareware, or free to use,
Current Version is 1.1.0.784
@{
if (User.Identity.Name == "")
{
<section id="login" style="text-align: left;">
@Html.Partial("_LoginPartial")
</section>
}
else {
<section>
@Html.ActionLink("Download Streakwave Reseller 2015", "StreakwaveReseller2015_DownloadApp", "Apps")
</section>
};
}
</p>
Now on this part, I'm not sure if I use the controller file, and change the view to code that starts the download. Or if I have to create or use the assigned model to do that. My knowledge learned says use the controller file. So if I use the controller file, then I don't need a view file then?, because there is no view.
public ActionResult StreakwaveReseller2015_DownloadApp()
{
return View();
}
Or am I completely off the tracks here on this one.
If I am on the right track, I not sure what to write in the controller action result, and point in the right direction would be of great service to me.
|
|
|
|
|
From my limited knowledge of MVC, I suspect you want to return a FileResult object by calling one of the File methods[^]:
public ActionResult StreakwaveReseller2015_DownloadApp()
{
return File("~/path/to/the/file.exe",
System.Net.Mime.MediaTypeNames.Application.Octet,
"TheDownloadFileName.exe");
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
My knowledge is limited as well here.
I thinks its a FileResult, I wrote this in the last 15 minutes, and it worked, very close to yours. Not sure if it's right or not.
But that's pretty slick in design, A action link on a view, in which the controller action lets you run the a small amount of code to download a file instead of showing another web page.
I have so much to learn here, I like being able to jam out code fast. Not bad considering I'm a VB guy by heart.
Let's see what others say about it. Thanks Richard!
public FileResult StreakwaveReseller2015_DownloadApp()
{
string filePath = Server.MapPath("~/Downloads/Streakwave/streakwave_1.1.0.784.exe");
byte[] fileBytes = System.IO.File.ReadAllBytes(filePath);
return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, "streakwave_1.1.0.784.exe");
}
|
|
|
|
|
Just make sure your ~/Downloads/Streakwave/ folder is protected, so that nobody can download the file directly.
You can change the settings through IIS or appcmd [^], or add the following to the web.config file in that folder:
<configuration>
<system.webServer>
<handlers accessPolicy="None" />
</system.webServer>
</configuration>
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|