16,019,140 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 Visual Basic questions
View Javascript questions
View .NET 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 wirec aaht (Top 13 by date)
wirec aaht
11-Aug-13 12:46pm
View
thanks really works, but why did it work before without skiping first column?
wirec aaht
7-Aug-13 13:16pm
View
sorry first time I forgot to save it. There it is http://jsfiddle.net/EAEKc/319/
wirec aaht
7-Aug-13 12:24pm
View
sorry first time I forgot to save it. There it is http://jsfiddle.net/EAEKc/319/
wirec aaht
5-Aug-13 18:05pm
View
I updated it to this :
@{Layout="_Layout.cshtml";
var authenticated= WebSecurity.IsAuthenticated;
Array userData;
if(authenticated)
{
var db = Database.Open("Cosa Nostra Tips");
var user = db.QuerySingle("SELECT * FROM UserProfile WHERE UserId=@0",WebSecurity.CurrentUserId);
userData = File.ReadAllLines(Server.MapPath("~/App_Data/"+user.Group));
}
}
@if(authenticated)
{
foreach (string dataLine in userData)
{
foreach (string dataItem in dataLine.Split(','))
{@dataItem <text> }
<br />
}
}
but it gives me error :
Compiler Error Message: CS0165: Use of unassigned local variable 'userData'
Source Error:
Line 14: @if(authenticated)
Line 15: {
Line 16: foreach (string dataLine in userData)
Line 17: {
which I dont understand is if condition is true userData should have value and also code should perfrom if its not than not.
wirec aaht
5-Aug-13 17:48pm
View
under variable user it is
wirec aaht
5-Aug-13 12:08pm
View
thanks a lot :)
wirec aaht
5-Aug-13 11:55am
View
if it would be possible I would rather not to use jQuery. :)
wirec aaht
4-Aug-13 15:05pm
View
nice man thanks :)
wirec aaht
3-Aug-13 5:12am
View
var name should contain name of user for example aaa but when I print it out using @name it contain System.Collections.ObjectModel.ReadOnlyCollection`1[System.Object]
wirec aaht
2-Aug-13 18:27pm
View
That i would do but var name = db.Query("SELECT User FROM UserProfile WHERE UserId= "+row.FromUserId) ); this is some strange format and i cant make var name to contain string :)
wirec aaht
2-Aug-13 13:09pm
View
I am using SQLServer I will paste here all page.
@{Layout="Layout.cshtml";
var db = Database.Open("test");
var query= "SELECT * FROM Messages WHERE FromUserID='"+WebSecurity.CurrentUserId+"' OR ToUserID='"+WebSecurity.CurrentUserId+"';";
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Správy</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="~/Scripts/jquery-1.9.1.js"></script>
<script src="~/Scripts/jquery-ui.js"></script>
<style>
#accordion-resizer {
padding: 10px;
width: 750px;
height: 350px;
}
</style>
<script>
$(function() {
$( "#accordion" ).accordion({
heightStyle: "fill"
});
});
$(function() {
$( "#accordion" ).accordion({
collapsible: true
});
});
/* $(function() {
$( "#accordion-resizer" ).resizable({
minHeight: 140,
minWidth: 200,
resize: function() {
$( "#accordion" ).accordion( "refresh" );
}
});
});*/
</script>
</head>
<body>
<div id="accordion-resizer" class="ui-widget-content">
<div id="accordion">
@foreach(var row in db.Query(query))
{
var name = db.Query("SELECT User FROM UserProfile WHERE UserId= "+row.FromUserId) );
@name
<div>
<p>
@row.Message v čase @row.CreateDate
</p>
</div>
}
</div>
</div>
</body>
</html>
wirec aaht
2-Aug-13 12:05pm
View
I want to use name of user in chat, but I only have ID. Like in WebSecurity is function GetUserId() I want it reverse. I have Id but I want name of user. :)
wirec aaht
2-Aug-13 4:12am
View
I think you dont understand me I want something like on facebook, you write name of registered user on web and you send him message. :)
Show More