|
SIMPLY INTRODUCED WHAT IS SILVERLIGHT?
shubham vijay
|
|
|
|
|
At least you should have asked this question in Silverlight[^] forum.
Before that you should have Googled[^] about that.
Start with MSDN[^]
BTW don't use ALL CAPS(means shouting) in internet.
|
|
|
|
|
On my intranet portal,Videos are playing on my system successfully.(Visual studio intalled on my system).But it is not playing on other systems when i host my portal on IIS.But after hosting on my system videos are played.
<embed id='embed1' runat="server" name='mediaPlayer' type='application/x-mplayer2' pluginspage='http://microsoft.com/windows/mediaplayer/en/download/' displaysize='4' autosize='-1' bgcolor='darkblue' showcontrols='true' showtracker='-1' showdisplay='0' showstatusbar='-1' videoborder3d='-1' width='500' height='405' designtimesp='5311' loop='false'>
</embed>
protected void DataList1_ItemCommand1(object source, DataListCommandEventArgs e)
{
try
{
if (e.CommandName == "select")
{
embed1.Attributes.Add("src", @"http://~/Uploads4/");
embed1.Attributes.Add("filename", Server.MapPath(e.CommandArgument.ToString()));
this.modal1.Show();
}
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
}
What problem can be?
modified 14-Nov-11 5:47am.
|
|
|
|
|
You have to convert the server file location to a qualified url
I wanted to give you an example, but I couldn't find it.
So you build a string, it can be virtual
/Movies/moviename.mpg
or hard code it
http://servername.domainname/movies/moviename.mpg
by the way, movie object have 2 sets of parameters, <embed /> is for firefox, and <object> is for ie.
check your object code for the latest version and update it.
|
|
|
|
|
|
Hi, everyone. I'm newbie in ASP.NET MVC framework. I've read "Pro asp.net MVC framework" and done a tutorial in this book. But i have problems with route table.
When i run application, the url: http://local:3425 listed some information in the page 1. But when i typed url: "http://local:3425/Page2", it got the error " Server Error in '/' Application.The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Page2"
Thanks in advance for any help.
Here it's the file Global.asax.cs
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
null, // Don't bother giving this route entry a name
"", // Matches the root URL, i.e. ~/
new { controller = "Products", action = "List", page = 1 } // Defaults
);
routes.MapRoute(
null, // Don't bother giving this route entry a name
"{controller}/{page}", // URL pattern, e.g. ~/Page683
new { controller = "Products", action = "Act" }, // Defaults
new { page = @"\d+" } // Constraints: page must be numerical
);
//routes.MapRoute(null, "{controller}/{action}");
}
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
ControllerBuilder.Current.SetControllerFactory(new WindsorControllerFactory());
}
}
And file Controller:
public class ProductsController : Controller
{
private IProductsRepository productsRepository;
public int PageSize = 2;
public ProductsController(IProductsRepository productsRepository)
{
this.productsRepository = productsRepository;
}
public ViewResult List(int page)
{
int numProducts = productsRepository.Products.Count();
ViewData["TotalPages"] = (int)Math.Ceiling((double)numProducts / PageSize);
ViewData["CurrentPage"] = page;
return View(productsRepository.Products
.Skip((page - 1) * PageSize)
.Take(PageSize)
.ToList());
}
|
|
|
|
|
First format your code snippets like everyone here does.
The resource can't be found because it does match any route you have defined. In each route the first element is expected to be the controller and you have no controller for Page
Although this is from a previous version of MVC the routing mechanism hasn't changed that much, maybe it will help you
ASP.NET MVC: Part 2[^]
No comment
|
|
|
|
|
Good Day all
i have the following
<%# clsFlow.CleanBondNumber(Eval("ATB_NUMBER"))%>
and the Function CleanBondNumber is defined like this
Public Shared Function CleanBondNumber(ByVal val As Object) As String
Dim Final_bond_acc_no As String = String.Empty
If (val.ToString().Contains("Offer")) Then
Dim Finalstring As String
Finalstring = val.ToString.Substring(6)
If (Finalstring.Contains(" ")) Then
Dim SpacePost As Integer
SpacePost = Finalstring.IndexOf(" ")
Final_bond_acc_no = Finalstring.Substring(0, SpacePost - 1)
Return Final_bond_acc_no
Else
Return val.ToString()
End If
Else
If (val.Contains(" ")) Then
Dim SpacePost As Integer
SpacePost = val.IndexOf(" ")
Final_bond_acc_no = val.Substring(0, SpacePost - 1)
Return Final_bond_acc_no
Else
Return val.ToString()
End If
End If
End Function
i stepped through the code and after it returns something i cant bind the Data, i get an Exception
<%# clsFlow.CleanBondNumber(Eval("ATB_NUMBER"))%> '=' expected.
Thanks
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa[at]dotnetfunda.com
http://www.Dotnetfunda.com
|
|
|
|
|
CommandName='<%# GetCommandNamebunit(Container.DataItem) %>'
And in code behind
Function GetCommandNamebunit(ByVal dataItem As Object) As String
GetCommandNamebunit = "demotext"
GetCommandNamebunit = String.Empty
Dim texpinnerText = DirectCast(dataItem, Object).texp
Dim bunitinnerText = DirectCast(dataItem, Object).bunit
Dim rexpinnerText = DirectCast(dataItem, Object).rexp
Dim bunitid = DirectCast(dataItem, Object).id
Dim Str_blevel
Dim str_alig
Dim str_TFrame
Dim str_bunit
Dim str_fiscalY
Str_blevel = sltBusinessLevel.SelectedValue
str_alig = sltAlignmentLevel.SelectedValue
str_TFrame = sltTimeFrame.SelectedValue
str_bunit = sltBusinessUnit.SelectedValue
str_fiscalY = sltFiscalYear.SelectedValue
If str_alig = 1 Then
If Str_blevel < 4 Then
If texpinnerText <> "0" Then
GetCommandNamebunit = "sendModuleValues"
End If
Else
If texpinnerText <> "0" Then
GetCommandNamebunit = "setonefacility"
End If
End If
Else
If Str_blevel < 3 Then
If texpinnerText <> "0" Then
GetCommandNamebunit = "sendModuleValues"
End If
Else
If texpinnerText <> "0" Then
GetCommandNamebunit = "setonefacility"
End If
End If
End If
End Function
This is working fine for you can take help from this.
Anuj
modified 14-Nov-11 3:24am.
|
|
|
|
|
Hello all,
I work for a small IT firm and I have been assigned a task to work with few in-house developers in developing our internal Employee Portal which include, Time Tracker System, HR Portal, Performance Tracker and Asset management System, All deployed on one Windows Small Business Server.
The requirements gathering and documentation is almost done and we are about to start working on core development.
However, as I lack a project level knowledge while developing web applications. Can I get help on what best practices should I be implementing even from the database design stage?
The application is intended to be interacted by close to 200 people and half of them concurrently, at times. Most of the data tables are expected to be use by different modules of the same application.
Any help with guidelines to be followed while designing the database and application layers, will be greatly appreciated.
Any freelancing or consulting help is also invited. You can send me an email sunilsasadm@gmail.com
Thank you.
|
|
|
|
|
I think there are other forums within CodeProject that may be a better place to post your question to.
|
|
|
|
|
oh okie. Could you please suggest the appropriate section?
|
|
|
|
|
On the left hand side, there are:
- Design and Architecture
- Database
|
|
|
|
|
Hello,
There is a page into my asp.net application which must be requested only by myself (administrator) or by an externel tool like Windows task scheduler, pingdom, curl.exe, and so on.
Because this page contains some code to send e-mail to many users.
When the page is requested par the following url http://www.mysite.com/Send.aspx the code behind do the work.
This page is'nt accessible by my web site interface but it's located at the web site roots.
Is there anyway to protect this page to avoid someone (a non-authorize user) run it???
thank's for your help
|
|
|
|
|
|
When the user click on the button in the datapager (like previous, next, 1,2,3,4,....), it should direct him/her to that page. Without the update panel, it works fine. However, with the update panel, only the first page can be correctly shown. When the users click the button in the datapager, even the listview disappear and I don't know why. I have searched for a few sites but none of them give me a satisfactory result. Am I missing out something? Thank you.
http://www.sendspace.com/file/c8yimj <----the aspx file (Please find the part marked with scriptmanager and update panel)
http://www.sendspace.com/file/nel2xu <---- the c# file (Please begin from the method DataPager1_PreRender
|
|
|
|
|
|
The code are here...
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" />
<asp:UpdatePanel ID="UpdatePanel1" Updatemode="Always" ChildrenAsTriggers="true" runat="server">
<ContentTemplate>
<asp:ListView ID="ListView1" runat="server"
OnItemCommand="ListView1_OnItemCommand" GroupItemCount="1">
<LayoutTemplate>
<div style="border: solid 1px black">
<table>
<asp:PlaceHolder ID="groupPlaceHolder" runat="server"></asp:PlaceHolder>
</table>
</LayoutTemplate>
<GroupTemplate>
<div>
<asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
</div>
</GroupTemplate>
<ItemTemplate>
<tr>
<td>
<asp:LinkButton ID="LinkButton1" CommandName="Delete_item" CommandArgument='<%# Eval("entry_no") %>' runat="server" Text="Delete!" />
</td>
</tr>
<tr>
<td>Location: <%#Eval ("location") %></td>
</tr>
<tr>
<td>Type:<%#Eval ("type") %><asp:ImageButton ID="ImageButton1" onClientClick = "Button1_onclick()" runat="server" ImageUrl="play.gif" CommandName="Listen" CommandArgument='<%#Eval("type") %>'/></td>
</tr>
<tr>
<td>Further Description: <%#Eval ("further_description") %><asp:ImageButton ID="Play_btn" runat="server" ImageUrl="play.gif" CommandName="Listen" CommandArgument='<%#Eval("further_description") %>' OnClientClick="popup('popUpDiv')" /></td>
</tr>
<tr>
<td><%# test_item_photo_name(Eval("items_photo_name").ToString()) %></td>
</tr>
<tr>
<td><asp:Button runat="server" Text="Play Recordings" CommandName="Recordings" CommandArgument='<%#Eval("recordings") %>' ID="recordings_btn" Visible="True" />
</tr>
</ItemTemplate>
</asp:ListView>
<asp:DataPager ID="pg" PageSize="1" runat="server" OnPreRender="DataPager1_PreRender" PagedControlID="ListView1">
<Fields>
<asp:NextPreviousPagerField ShowFirstPageButton="True" ShowNextPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ShowLastPageButton="True" ShowPreviousPageButton="False" />
</Fields>
</asp:DataPager>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</div>
Code behind:
protected void DataPager1_PreRender(object sender, EventArgs e)
{
DataTable result = (DataTable)Session["result"];
ListView1.DataSource = result;
ListView1.DataBind();
}
protected void pg_PagerCommand(object sender, DataPagerCommandEventArgs e)
{
e.NewMaximumRows = e.Item.Pager.MaximumRows;
switch (e.CommandName)
{
case "Previous":
if (e.Item.Pager.StartRowIndex > 0)
e.NewStartRowIndex = e.Item.Pager.StartRowIndex - 1;
break;
case "Next":
e.NewStartRowIndex = e.Item.Pager.StartRowIndex + 1;
break;
}
}
protected void ListView1_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
{
DataPager dpBottom;
dpBottom = ((ListView)sender).FindControl("pg") as DataPager;
dpBottom.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
ListView1.DataBind();
UpdatePanel1.Update();
}
protected void ListView1_OnItemCommand(object sender, ListViewCommandEventArgs e)
{
Label1.Visible = false;
if (String.Compare(e.CommandName.ToString(), "Recordings") == 0)
{
if (String.Compare(e.CommandArgument.ToString(), "") == 0)
{
Label1.Visible = true;
Label1.Text = "No recordings found.";
}
else
{
String path = Server.MapPath(".") + "\\" + login_hash + "\\others\\" + e.CommandArgument.ToString();
Play(path);
}
}
else
{
if (String.Compare(e.CommandName.ToString(), "Listen") == 0)
{
Speak(e.CommandArgument.ToString());
}
if (String.Compare(e.CommandName.ToString(), "Delete_item") == 0)
{
DataTable result = (DataTable)Session["result"];
for (int i = 0; i < result.Rows.Count; i++)
{
if (result.Rows[i]["entry_no"].ToString() == e.CommandArgument.ToString())
{
if (result.Rows[i]["recordings"].ToString() != "")
{
File.Delete(Server.MapPath(".") + "\\" + login_hash + "\\others\\" + result.Rows[i]["recordings"].ToString());
}
if (result.Rows[i]["items_photo_name"].ToString() != "")
{
File.Delete(Server.MapPath(".") + "\\" + login_hash + "\\images\\item_photo" + result.Rows[i]["items_photo_name"].ToString());
}
DataList1_ItemCommand(sender, null);
}
}
try
{
String query = "delete from items_location where entry_no = " + e.CommandArgument.ToString();
Database.OpenConnection();
Database.BeginTransaction();
Database.Update_Insert(query);
Database.CommitTransaction();
Database.CloseConnection();
ListView1.DataSource = result;
ListView1.DataBind();
Session.Remove("result");
Session["result"] = result;
}
catch (Exception ex)
{
Database.RollBackTransaction();
Database.CloseConnection();
}
}
}
}
|
|
|
|
|
Hi,
I have a flash map in my site, which cannot be displayed inside iframes in other domains. So what I wnat to do, is to check the domain name when the page is loaded and hide the flash map if it's other than my domain.
I have heared that there is a commonly used code for hiding flash in Iphones, that can be useful for me, but I couldn't find it, so maybe sompne can copy the code for me.
Thanks, Ben
|
|
|
|
|
benams wrote: there is a commonly used code for hiding flash in Iphones
Its called not being supported. Flash won't even load on an iPhone, iPod or iPad.
No comment
|
|
|
|
|
two articles on browser detection:
http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting[^]
http://jibbering.com/faq/notes/detect-browser/[^]
my recommendation though is to use a javascript framework which will take on most of the work for you. once you have determined your browser you can simply hide the div by setting its css display property to none .
just a note though you might still run into problems with the flash trying to run? I am not a huge fan of flash so I have never tried this route before.
my recommendation would be to add the iframe to your document only after you have determined that the browser supports it.
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|
Hello,
Into my asp.net application every day i download an xml file and store the values in my database. After did this, i display this xml file using an aspx page. After displaying, an e-mail is sent to 2000 users who are subscribe to this info.
My problem is that i want to dipslay first the page to confirm there is no problem, then send the e-mail but because i use Response.Redirect function my code for sending e-mail is never run. If i send first the e-mail, i must wait for the end (5 minutes) before displaying xml value into my page.
Therefore i would to display my page and execute at the same time the function to send e-mail or sending the e-mail in asynchronous mode.
The part of my code with this problem is the following :
iRes = mydb.DBRecordPublication(strFilename, sDate, snumero, sDoc)
If iRes >= 0 Then
Dim NomMagazine As String = strFilename
Response.Redirect("ShowNews.aspx?News=" & NomMagazine & "&DateNews=" & sDate & "&ConnecString=" & mydb.GetConnectionString())
Dim strRes As String = myMail.SendSommaire(Me.Context)
end if
thanks in advance for any help
|
|
|
|
|
Although you can implement an aysnc page you may be better using Ajax. Display the page with a button to send the emails. The button will call an Ajax function that will send the emails. A side benefit is you can get updates on the number of emails sent, if you code it that way.
No comment
|
|
|
|
|
In a C# 2010 web form application that I will be working on, I want to place a dropdown list control in a detailview control. I do not these that control as one of embedded controls you can use. I do see controls like a hyperlink.
Thus can you tell me or point me to a reference so that I see how to place a dropdown list control within a detailsview control?
|
|
|
|
|
lmgtfy[^]
as if the facebook, twitter and message boards weren't enough - blogged
|
|
|
|
|