15,885,546 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Abrar Kazi (Top 131 by date)
Abrar Kazi
9-Oct-17 23:57pm
View
I am using Razor Engine still it fetches aspx first.
Abrar Kazi
15-Jun-17 1:07am
View
Thanks.
Abrar Kazi
10-Apr-17 7:29am
View
I now updated jquery ui 1.11.3 to jquery 1.12.1 and it worked fine.
The only thing now i need to check is if the update on jquery doesnt affect any other operation wrt jquery as this website will go live with the change.
Thank u so much for your help. Cheers :)
Abrar Kazi
10-Apr-17 3:20am
View
Hi Karthik , theres a new discovery of possible problem found in this case i guess.
in my Layout Page these are the scripts :
<script src="@Url.Content("~/Scripts/jquery.1.11.3-min.js")">
<!-- Datepicker Form -->
jquery and jquery ui versions mismatch . could this be the reason ?
Abrar Kazi
6-Apr-17 6:25am
View
i tried it seperately in other project and it works fine there
Abrar Kazi
6-Apr-17 4:25am
View
i removed the above :
@Html.TextBoxFor(m => m.dobclient, "{0:dd/MM/yyyy}", new { @id = "txtdobclient" })
$('#txtdobclient').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'dd/mm/yy',
defaultDate: new Date(),
yearRange: "-100:+0"
});
didnt work
Abrar Kazi
6-Apr-17 3:33am
View
ok i will give u my code here try it at your end :
Partial View :
@Html.TextBoxFor(m => m.dobclient, "{0:dd/MM/yyyy}", new { @id = "txtdobclient", @class = "DateOfBirth DefaultToolTip", @tabindex = 15, @data_toggle = "tooltip", @data_placement = "right" })
Script in Partial View :
$('.DateOfBirth').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'dd/mm/yy',
defaultDate: new Date(),
yearRange: "-100:+0"
});
View :
@Html.Partial("_PartialViewName", Model)
Abrar Kazi
6-Apr-17 3:17am
View
The month dropdown works perfectly, its just the year dropdown creating problem. Also i removed yearRannge attribute and tried still it doesnt work.
if yearRange = -100:+0 so 1917 is selected if i choose any year before 2000
if yearRange = -100:+100 so if i select 1950 it selects 2050 , if 1970 it selects 2070 and so on.
Abrar Kazi
6-Apr-17 3:13am
View
Did that, no it doesnt work.
also note the class above is used by multiple textboxes. could that be a reason ?
Abrar Kazi
6-Apr-17 3:06am
View
no i guess. it just has this reference :
<script src="@Url.Content("~/Scripts/InputFieldFormat.js")">
Which reference am i missing ? and where should it be referenced in partial view or view
Abrar Kazi
6-Apr-17 2:47am
View
i forgot to mention the textbox datepicker is in partial view does this have a problem ?
Abrar Kazi
5-Apr-17 8:09am
View
ok thanks a lot for the time will see what im missing. meanwhile if you think i m missing something and that reminds you do post a comment
Abrar Kazi
5-Apr-17 7:57am
View
yes its exactly the same as my code dont know where i am going wrong
Abrar Kazi
5-Apr-17 7:56am
View
yes it wont. lets forget about the validation i commented it. still the year displayed is wrong. but the calendar displayed is right and on date selection it will display proper date i.e. 21/02/1995 but on year dropdown it will show 1917
Abrar Kazi
5-Apr-17 7:52am
View
even if i dont put validation above it will not work the same. assume there is no validation if i comment that function still id doesnt work so i doubt if validation msg has anything with it .
Abrar Kazi
5-Apr-17 7:51am
View
im checking if the value in textbox is not empty.
If it is not empty it will check if date[2] which is year of that date length is 4 eg 2001 if not it will go inside
Abrar Kazi
5-Apr-17 7:44am
View
@Html.TextBoxFor(m => m.dobclient, "{0:dd/MM/yyyy}", new { @id = "txtdobclient", @class = "DOB DefaultToolTip", @tabindex = 15, @data_toggle = "tooltip", @data_placement = "right" )
Abrar Kazi
5-Apr-17 7:42am
View
dateValue1 : value of textbox in which date is selected
date2 : id of txtbox
Abrar Kazi
5-Apr-17 7:37am
View
it is called as :
$("#txtdobclient").blur(function () {
PopulateFormateddate($("#txtdobclient").val(), $("#txtdobclient"));
});
Abrar Kazi
5-Apr-17 7:37am
View
yes this one :
function PopulateFormateddate(dateValue1, date2) {
if (dateValue1 != "") {
var date = dateValue1.split("/");
if (date[2].length != 4) {
var intyear = parseInt(date[2]);
if (intyear >= 30)
{
date[2] = parseInt(date[2]) + 1900;
}
else {
date[2] = parseInt(date[2]) + 2000;
}
}
var myDate = null;
try {
var myDate = new Date(parseInt(date[2])+ 0 , date[1] -1, parseInt(date[0]));
}
catch (err) {
myDate = null;
}
if (myDate != 'Invalid Date') {
$(date2).datepicker('setDate', myDate);
}
}
}
Abrar Kazi
5-Apr-17 7:33am
View
nope i checked that . the date after selection goes red if u see the pic and i couldnt change the date then
Abrar Kazi
5-Apr-17 7:32am
View
http://imgur.com/47H3oUs
Abrar Kazi
5-Apr-17 7:31am
View
what possibly could go wrong here i cannot upgrade to 1.12
Abrar Kazi
5-Apr-17 7:30am
View
http://imgur.com/47H3oUs
Abrar Kazi
5-Apr-17 7:28am
View
ok. http://imgur.com/a/sJnOA
Abrar Kazi
5-Apr-17 7:23am
View
can we skype i can share images ?
Abrar Kazi
5-Apr-17 7:23am
View
1.11
Abrar Kazi
6-Mar-17 4:37am
View
Yes i created another key for connectionstring and assigned it to Elmah to log in error using that connection string . Still it doesnt enter data to sql database. also i have given all the permissions to the database table and scripts .
Abrar Kazi
6-Mar-17 4:19am
View
Yes i am trying to save the Errors in Sql Server as well i am trying to send an email
Abrar Kazi
3-Mar-17 7:15am
View
how do i debug a Webcongif file ? all the code for ElMAH resides in web config as per my knowledge
Abrar Kazi
3-Mar-17 0:28am
View
That is the only coding for Elmah setup i.e. WebConfig
Abrar Kazi
12-Dec-16 4:42am
View
This works only when the words are same .
Like keylist has a word : Abc and oldfilesselected has a word : Hi Abc
then it wont work it gives -1 as output
Abrar Kazi
25-Nov-16 0:32am
View
that is the only code. Values are assigned once to the table and that's it no alteration whatsoever still to the table but on the same view an ajax call is made to display a partial view.
Abrar Kazi
22-Nov-16 1:15am
View
ok
Abrar Kazi
22-Nov-16 0:14am
View
Thanks it helped.
I have updated my question please look into it and help. thanks
Abrar Kazi
21-Oct-16 9:11am
View
What possibly went wrong in my code ?
If I am removing the dialogue box call and just calling Ajax it works fine but when I am calling Ajax inside dilog box button click it prompts the error
Abrar Kazi
21-Oct-16 7:53am
View
no it does not work without debugger. Yes i tried with mozilla and i didnt get the error. But i want to solve it i cant just leave it like that.
There must be some solution.
Abrar Kazi
21-Oct-16 1:17am
View
Now i have updated the question there is no ajax call no other methods in dialog box but still when the debugger comes to Yes click i throws the same error.
Abrar Kazi
21-Oct-16 1:17am
View
Now i have updated the question there is no ajax call no other methods in dialog box but still when the debugger comes to Yes click i throws the same error.
Abrar Kazi
20-Oct-16 8:42am
View
as i mentioned error occurs before the debugger enters the ajax call . as soon as Yes is called it throws the error
Abrar Kazi
6-Oct-16 4:26am
View
the problem is not about the function onkeypress . its working fine in chrome.. the problem is in Firefox
Abrar Kazi
28-Sep-16 8:14am
View
ok i will try . i got a work around , im using Redirect("ViewName") whenever the user is clicking before agreeing to TnC as i store a value of tnc agreement in session. if its null im redirecting agin to the same Index page thus not allowing user to go further
Abrar Kazi
28-Sep-16 7:41am
View
can u tell me how do i do this "or alternatively disable the elements on the page"
Abrar Kazi
28-Sep-16 7:07am
View
So how do i achieve it ?
Abrar Kazi
28-Sep-16 3:16am
View
You are right but i cannot add another page. I have to find some other way to block the page for the time modal is loading.
Abrar Kazi
26-Sep-16 7:00am
View
ok
Abrar Kazi
26-Sep-16 3:02am
View
on click should be outside the $(function(){}) thats what i changed.
Abrar Kazi
26-Sep-16 3:01am
View
Worked perfectly.
Abrar Kazi
26-Sep-16 2:41am
View
Thanks Karthik.
Abrar Kazi
19-Sep-16 9:14am
View
yes
Abrar Kazi
19-Sep-16 6:06am
View
yes i have updated he quesion
Abrar Kazi
16-Sep-16 8:59am
View
no as i mentioned above i am searching in a autcomplete "textbox"
Abrar Kazi
8-Sep-16 9:47am
View
I already checked that and did exactly the same still the problem exist. I dont know where i am going wrong
Abrar Kazi
8-Sep-16 8:12am
View
Please look into this.
http://www.codeproject.com/Questions/1125954/Model-becomes-empty-on-pagedlist-nd-page-click
Abrar Kazi
8-Sep-16 7:30am
View
Thanks
Abrar Kazi
8-Sep-16 7:30am
View
ok thanks everyone i am applying paging
Abrar Kazi
30-Aug-16 12:29pm
View
StringWriter sw = new StringWriter();
dataSet.WriteXml(sw);
string result = sw.ToString();
Heres the code I'm using
Abrar Kazi
30-Aug-16 12:29pm
View
StringWriter sw = new StringWriter();
dataSet.WriteXml(sw);
string result = sw.ToString();
Heres the code I'm using
Abrar Kazi
30-Aug-16 12:29pm
View
StringWriter sw = new StringWriter();
dataSet.WriteXml(sw);
string result = sw.ToString();
Heres the code I'm using
Abrar Kazi
22-Jul-16 5:31am
View
Deleted
I assume u r calling serverside events for paging and sorting.
Call paging and sorting using Ajax and i should not hide ur popup.
Abrar Kazi
22-Jul-16 2:22am
View
Thanks :)
Abrar Kazi
22-Jul-16 2:22am
View
Thanks Karthik
Abrar Kazi
20-Jul-16 8:52am
View
Thanks :)
Abrar Kazi
20-Jul-16 8:52am
View
Thanks :)
Abrar Kazi
20-Jul-16 8:52am
View
Thanks :)
Abrar Kazi
19-Jul-16 1:18am
View
Thanks :)
Abrar Kazi
12-Jul-16 2:55am
View
Deleted
put your application under abcd folder and publish again
Abrar Kazi
12-Jul-16 2:53am
View
ASp.net c#
Abrar Kazi
11-Jul-16 9:21am
View
Thank you so much for helping me. :)
Abrar Kazi
11-Jul-16 9:20am
View
ok karthik i got it:
BEFORE :
ScriptManager.RegisterStartupScript(Page, GetType(), "QDSDiscontinuedAlertU", "<script>alert('This QDS has been discontinued.');</script>", true);
AFTER:
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "QDSDiscontinuedAlertU", "<script>alert('This QDS has been discontinued.');</script>", false);
This worked for me.
Abrar Kazi
11-Jul-16 8:59am
View
there is no error in the code
Abrar Kazi
11-Jul-16 8:58am
View
its not an error.. yes when a collection is discontinued it goes into alert statement.. after alert if i change item of ddlserial it doesnt fire change event
Abrar Kazi
11-Jul-16 8:14am
View
no
Abrar Kazi
11-Jul-16 7:30am
View
are dear i told u its working on remote server but after deployment it is giving problem
Abrar Kazi
11-Jul-16 6:43am
View
when i select item from ddlserial it postbacks.
2nd n 3rd means example : first time when i select a item it selectedindex change event fires .. again when i select a different item selectedindex change event doesnot fires, again when i select it fires etc .. and so on..
Abrar Kazi
11-Jul-16 6:41am
View
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 400
It gives this error in console.
Abrar Kazi
11-Jul-16 6:35am
View
issue is on ddlserial.. ChangeEvent occurs once then it doesnt the 2nd time then it occurs the 3rd time not for 4th and so on
Abrar Kazi
11-Jul-16 6:35am
View
Deleted
ddlserial.. ChangeEvent occurs once then it doesnt the 2nd time then it occurs the 3rd time not for 4th and so on
Abrar Kazi
11-Jul-16 6:17am
View
Please consider UpdatePanel & IIS .. I think one of these 2 are causing problem .
Abrar Kazi
11-Jul-16 6:16am
View
ddlCollection_SelectedIndexChanged : On this dropdown change ddlSerial is filled .. but the problem is on ddlSerial change event
Abrar Kazi
11-Jul-16 6:16am
View
Deleted
ddlCollection_SelectedIndexChanged : On this dropdown change ddlSerial is filled .. but the problem is on ddlSerial change event
Abrar Kazi
11-Jul-16 5:28am
View
check the updated question
Abrar Kazi
11-Jul-16 4:40am
View
there is another dropdownlist whose selected index change is assigning values to this dropdownlist.
Abrar Kazi
9-Jun-16 0:15am
View
Could you give a code for the above scenario
Abrar Kazi
7-Jun-16 1:09am
View
Thanks Tomas agreed to your suggestion. Its quite an easy task using loops in C#. Thanks.
Abrar Kazi
4-Jun-16 23:12pm
View
So what do you suggest?
Abrar Kazi
31-May-16 0:26am
View
Thank you so much for replying Karthik.
Abrar Kazi
31-May-16 0:22am
View
Thanks for the information.
Abrar Kazi
31-May-16 0:22am
View
Thanks man you are awesome.
Abrar Kazi
27-May-16 0:54am
View
A link button even is invoked when the user clicks on the link.
Another thing you fail to understand is this: lnkOrderDetail_Click is not an event. At best it can be used as an even handler, but only if you really added this method (this is just a method, that's it)
As u said a link button is invoked when a user click on it, heres the problem im stuck to when a user clicks on any lnkbutton inside repeater the event is not handled . Pls help
Abrar Kazi
26-May-16 5:13am
View
Deleted
protected void lnkOrderDetail_Click(object sender, EventArgs e)
{
}
THe problem is the debugger doesnt come to this click event
Abrar Kazi
11-May-16 4:03am
View
i took repeater and my designer helped me with a css that helped me not to fix the header and allow scroll horizontally.
Thanks :)
Abrar Kazi
19-Apr-16 7:42am
View
What could be Membership and Identity in this case ?
Abrar Kazi
19-Apr-16 7:41am
View
FORMS
Abrar Kazi
19-Apr-16 1:19am
View
Yes i tried that and its working good .. But is there any other solution as i have read HTTP_Referrer not necessarily gives information always.
Abrar Kazi
19-Apr-16 1:16am
View
Deleted
Guys you'll are not getting me.. Its an inhouse development.. Let me give u an example..
(This application will be used within a particular place say an office.)
Example:
There are 10 employees
5 Accounts
5 IT
Now the menus appear as per user role. IT Guy will have only IT menus visible and same with Accounts team.
But if a IT guy manually types something like ../Pages/Accounts.aspx then i want him to be redirected to Login Page again.. Now thats a requirement..
Now suggest.
Abrar Kazi
19-Apr-16 1:16am
View
Guys you'll are not getting me.. Its an inhouse development.. Let me give u an example..
(This application will be used within a particular place say an office.)
Example:
There are 10 employees
5 Accounts
5 IT
Now the menus appear as per user role. IT Guy will have only IT menus visible and same with Accounts team.
But if a IT guy manually types something like ../Pages/Accounts.aspx then i want him to be redirected to Login Page again.. Now thats a requirement..
Now suggest.
Abrar Kazi
19-Apr-16 1:16am
View
Guys you'll are not getting me.. Its an inhouse development.. Let me give u an example..
(This application will be used within a particular place say an office.)
Example:
There are 10 employees
5 Accounts
5 IT
Now the menus appear as per user role. IT Guy will have only IT menus visible and same with Accounts team.
But if a IT guy manually types something like ../Pages/Accounts.aspx then i want him to be redirected to Login Page again.. Now thats a requirement..
Now suggest.
Abrar Kazi
19-Apr-16 1:16am
View
Guys you'll are not getting me.. Its an inhouse development.. Let me give u an example..
(This application will be used within a particular place say an office.)
Example:
There are 10 employees
5 Accounts
5 IT
Now the menus appear as per user role. IT Guy will have only IT menus visible and same with Accounts team.
But if a IT guy manually types something like ../Pages/Accounts.aspx then i want him to be redirected to Login Page again.. Now thats a requirement..
Now suggest.
Abrar Kazi
22-Feb-16 2:08am
View
Perfect solution! Thanks mate.
Abrar Kazi
20-Feb-16 12:13pm
View
Thanks buddy. I would definitely try this.
Abrar Kazi
20-Feb-16 9:57am
View
I already have included them. But it doesn't work.
Abrar Kazi
21-Jan-16 2:50am
View
have sent u a mail with my requirements
Abrar Kazi
21-Jan-16 2:49am
View
Session i am using to temporarily store BRANCH CONTACT Details. At Final SAVE button data will be saved as
2 or n BranchContacts against 1 Branch.
Abrar Kazi
20-Jan-16 5:04am
View
Deleted
Becoz i return partial view only when ModelState is valid if not i return json result=0 . I may be conceptually doing this wrong.
Abrar Kazi
20-Jan-16 5:02am
View
Deleted
skype: aby14990
email: abrar.kazi@hotmail.com
Abrar Kazi
20-Jan-16 4:11am
View
can i send u images to clear the scenario ?
can i have a skypeid or emaild id of yours.
Abrar Kazi
20-Jan-16 4:11am
View
i am using webgrid
Abrar Kazi
20-Jan-16 4:10am
View
see i am asking what is the better way to handle this scenario?
When i click on a AddNewContact a Bootstrap Popup appears i enter the fields in the popup and click on save. This saved record is displayed in the webgrid.
(Before saving this record i want to check if ModelState.Isvalid is true or not. If yes save record in session n display in webgrid. If not it should show required Fields error in the popup.)
Abrar Kazi
20-Jan-16 0:56am
View
There are many questions i am unable to get answers for..
If my model state is true i am returning to Partial View if not i return Json..
I mean how do i come back to the script if i am sending data to partial view.
Its all messed up with only this grid part.
Please help
Abrar Kazi
20-Jan-16 0:51am
View
I have a Branch Page where in there is a BranchContactPerson Grid in the page.
If a Branch has 2 contact person i will have to add them. I click on a + sign(image) and a Bootstrap Modal Popup opens where i fill Name Department etc of that contact person and save.
On save the data i filled is showed in the grid.
This grid part and modal popup part has taken half of my life.
If i do this i think i can pretty much learn MVC.
This is my first project and i am 7 days old to MVC.
Abrar Kazi
20-Jan-16 0:47am
View
@using (Ajax.BeginForm("AddBranchContact", new AjaxOptions { OnSuccess = "OnSuccess", UpdateTargetId = "myTable" }))
{
//contactModal code
}
<script type="text/javascript">
function OnSuccess(e) {
debugger;
if (e.result == 0)
{
$('#myModal1').modal('show');
}
else
{
$('#myModal1').modal('hide');
}
}
</script>
Abrar Kazi
20-Jan-16 0:45am
View
public ActionResult AddBranchContact(BranchViewModel objBranchContact)
{
List<BranchContact> BranchContactList = new List<BranchContact>();
if (ModelState.IsValid)
{
if (Session["BranchContactList"] == null)
{
BranchContactList.Add(objBranchContact.BranchContactDetails);
objBranchContact.BranchContactList = BranchContactList;
Session["BranchContactList"] = BranchContactList;
Session["BranchDetails"] = objBranchContact.BranchDetails;
return PartialView("BranchContactWebGridView", objBranchContact);
}
else
{
List<BranchContact> ContactList = Session["BranchContactList"] as List<BranchContact>;
ContactList.Add(objBranchContact.BranchContactDetails);
Session["BranchContactList"] = ContactList;
Session["BranchDetails"] = objBranchContact.BranchDetails;
objBranchContact.BranchContactList = ContactList;
return PartialView("BranchContactWebGridView", objBranchContact);
}
}
else
{
return Json(new { result = 0 });
}
}
Abrar Kazi
19-Jan-16 7:51am
View
As you said I returned result=0 and caught that in OnSuccess='script name'.
In the script,
if result = 0 i am not hiding the modal but the Fields do not show the validation messages..
Please see this:
<div class="col-md-6">
@Html.LabelFor(m => m.BranchContactDetails.FirstName)
<div >
@Html.EditorFor(m => m.BranchContactDetails.FirstName, new { htmlAttribute = new { @class = "form-control" } })
@Html.ValidationMessageFor(m => m.BranchContactDetails.FirstName, "", new { @class = "text-danger" })
</div>
</div>
if first name is not filled than ModelState.Isvalid = false so it will return:
return Json(new { result = 0 });
the modal will be as it is but the validation messages are not displayed
Abrar Kazi
19-Jan-16 6:46am
View
Deleted
Sorry one more problem occured.
If(ModelState.Isvalid)
{
}
Abrar Kazi
19-Jan-16 6:11am
View
Thank you very much. Solved.
Abrar Kazi
19-Jan-16 5:19am
View
As u said :
In your scenario, return a flag to OnSuccess event handler and check the value of flag and accordingly hide or show your modal.
Can u tell me how to return flag from controller to Onsuccess event handler
Abrar Kazi
19-Jan-16 5:17am
View
Thank you so much John. I will definitely try these links and hope i'll solve my problem.
Abrar Kazi
19-Jan-16 2:14am
View
The problem is :
As u see above I am doing something on OnSuccess attribute. But when there is an OnSuccess=false scenario i dont want that modal to hide.
Any suggestions ?
AddBranchContact is my Action Method.
where i am doing this
ModelState.IsActive()
{
do something
}
else
{
return Onsuccess =false Note: How to send Onsuccess as false is also a problem.
}
And if false i dont want Modal to hide as written in Ajax.BeginForm
Abrar Kazi
16-Jan-16 7:01am
View
Could you please look into this i am very much stuck into it.
http://www.codeproject.com/Questions/1072174/How-to-notify-Onsuccess-in-Ajax-BeginForm-as-false
Abrar Kazi
16-Jan-16 4:10am
View
Yes you were right. I tried removing the outParamBranchContactID n it worked fine. Thank you so much Mika you saved me a lot of time.
Abrar Kazi
14-Jan-16 6:50am
View
Deleted
var outParam = new SqlParameter();
outParam.ParameterName = "@BranchIDOut";
outParam.SqlDbType = SqlDbType.Int;
outParam.Direction = ParameterDirection.Output;
var data = db.Database.SqlQuery<int>("TempspInsertBranch @Code,.......,@CreatedUser,@BranchIDOut OUTPUT",
new SqlParameter("Code", Code),
.
.
.
. new SqlParameter("CreatedUser", User),
outParam);
int i = Convert.ToInt32(outParam.Value.ToString());
I now tried this but the SP returns null output parameter value.
Abrar Kazi
14-Jan-16 6:49am
View
It would be great if u would help me modify the above code.
Also the links provided are not for MVC.
Abrar Kazi
14-Jan-16 5:28am
View
Yes
Abrar Kazi
14-Jan-16 1:15am
View
Ok my silly. I passed the wrong Parameter in ActionMethod.
BranchContact objBranchContact should have been BranchViewModel objBranchContact
Abrar Kazi
13-Jan-16 6:44am
View
No thats not wat i exactly was looking for. Thanks.
Abrar Kazi
13-Jan-16 3:01am
View
It worked.
DataTable userinfoDataTable = new DataTable();
DataRow dr;
List<login> tuserDetails = db.Database.SqlQuery<login>("exec [spGetUserDetails] @EmailID = {0}", login.EmailID)
.Select(x => new Login { LoginPassword = x.LoginPassword.ToString(), LoginPasswordSalt = x.LoginPasswordSalt, UserID = x.UserID, EmailID = x.EmailID }).ToList();
userinfoDataTable.Columns.Add("UserID", typeof(int));
userinfoDataTable.Columns.Add("EmailID", typeof(string));
foreach (var i in tuserDetails)
{
dr = userinfoDataTable.NewRow();
dr["UserID"] = i.UserID;
dr["EmailID"] = i.EmailID;
userinfoDataTable.Rows.Add(dr);
}
DataTable finaldt = new DataTable();
finaldt = userinfoDataTable.Copy();
To all the coders: if u find a better way than this then do post and help.
Abrar Kazi
12-Jan-16 1:21am
View
Ok sure. Thanks.
Abrar Kazi
12-Jan-16 1:00am
View
Thanks for the help but it didnt work. I tried this myself before posting my question, it says :
"Cannot convert type 'WPFL.ViewModel.Login' to 'System.Data.DataTable'"
Abrar Kazi
30-Oct-14 11:06am
View
Deleted
I am not getting AutoCompleteCustomAutoCompleteCustomSource class in my project even though i have included System. Windows. Forms
Abrar Kazi
30-Oct-14 11:05am
View
I am not getting AutoCompleteCustomSource class in my project even though i have included System. Windows. Forms
Show More