|
|
I was wondering if there was a Bing equivalent.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
I have a ListView set up with a LinqDataSource on an Entity Framework model. In LinqDataSource, I haven't used "Select" and have enabled Update. For Some reason I keep getting this error message even though the Id exists as the primary key in that table. In the Class Viewer I can see that Quiz has a public property for d. The table name is Quizs but it is singularized in Entity Framework. When I put in a Select and disable Update, the fields display propertly, even Id if I include that.
<asp:ListView ID="ListView1" runat="server"
DataSourceID="LinqDataSource1"
onselectedindexchanged="ListView1_SelectedIndexChanged"
OnItemInserting="ListView1_ItemInserting" DataKeyNames="Id">
<EditItemTemplate>
<tr style="">
<td>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update"
Text="Update" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Cancel" onclick="OperationCanceled" onclientclick="return confirm('Are You Sure You Wish To Cancel? You will Lose Any Changes Made.');" />
</td>
<td>
<asp:LinkButton ID="lnkSelect" runat="server" CommandName="Select"
Text="Select" />
</td>
<td>
<asp:TextBox ID="LongDescriptionTextBox2" runat="server"
Text='<%# Bind("LongDescription") %>' />
</td>
<td>
<asp:TextBox ID="DescriptionTextBox" runat="server"
Text='<%# Bind("Description") %>' />
</td>
</tr>
</EditItemTemplate>
<EmptyDataTemplate>
<table runat="server" style="">
<tr>
<td>
No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="background-color: #336699; color: White;">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert"
Text="Insert" />
<asp:Button ID="CancelButton2" runat="server" CommandName="Cancel"
Text="Clear" />
</td>
<td>
<asp:LinkButton ID="lnkSelect2" runat="server" CommandName="Select"
Text="Select" />
</td>
<td>
<asp:TextBox ID="LongDescriptionTextBox3" runat="server"
Text='<%# Bind("LongDescription") %>' />
</td>
<td>
<asp:TextBox ID="DescriptionTextBox3" runat="server"
Text='<%# Bind("Description") %>' />
</td>
</tr>
</InsertItemTemplate>
<ItemTemplate>
<tr style="">
<td>
<asp:LinkButton ID="lnkSelect3" runat="server" CommandName="Select"
Text="Select" />
<asp:LinkButton ID="LinkButtonEditQuiz" runat="server" CommandName="Edit"
Text="Edit" />
</td>
<td> <asp:Button ID="DeleteButton3"
Text="Delete"
OnClick="DeleteButton_Click"
runat="server" />
<br /></td>
<td>
<asp:Label ID="LongDescriptionLabel2" runat="server"
Text='<%# Eval("LongDescription") %>' />
</td>
<td>
<asp:Label ID="DescriptionLabel2" runat="server"
Text='<%# Eval("Description") %>' />
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table runat="server" cellpadding="3" cellspacing="0" rules="all"
style="border: solid 2px #336699;">
<tr runat="server">
<td runat="server">
<table ID="itemPlaceholderContainer" runat="server" border="0" style="">
<tr runat="server" style="background-color: #336699; color: White;">
<th ID="Th1" runat="server">
Select</th>
<th runat="server">
Delete</th>
<th runat="server">
LongDescription</th>
<th runat="server">
Description</th>
</tr>
<tr ID="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server" style="">
</td>
</tr>
</table>
</LayoutTemplate>
<SelectedItemTemplate>
<tr style="background-color: #336699; color: White;">
<td>
<asp:LinkButton ID="lnkSelect4" runat="server" CommandName="Select"
ForeColor="White" Text="Select" />
<asp:LinkButton ID="LinkButtonEditQuiz2" runat="server" CommandName="Edit"
ForeColor="White" Text="Edit" />
</td>
<td> <asp:Button ID="DeleteButton2"
Text="Delete"
OnClick="DeleteButton_Click"
runat="server" />
<br /></td>
<td>
<asp:Label ID="LongDescriptionLabel" runat="server"
Text='<%# Eval("LongDescription") %>' />
</td>
<td>
<asp:Label ID="DescriptionLabel" runat="server"
Text='<%# Eval("Description") %>' />
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="HW4.Model1Container" EntityTypeName="" TableName="Quizs"
EnableUpdate="True"
EnableInsert="True">
</asp:LinqDataSource>
|
|
|
|
|
Hello, I need to design a method of integration of several independent applications, this integration means:
* have a common layout, css
* have a common header, footer and menu
* have a unifiyed login method
Some of theses applications are "big", so I guess joining and compiling is not a good idea.
The alternative I'm thinking of is creating a MasterPage or custom control which draws header, menu and implements access security. Then, modify ALL pages in every applicaion to be "child" of this MasterPage or include this control.
How do you like this solution?
Is there a better one?
What is better, MasterPage or Custom Control?
Thak you
|
|
|
|
|
I think you should do some research on SSO, REST, WCF and take whichever is suitable for integration. Offcourse you need to use Master pages, custom control, User control and CSS whereever required in you Master Project.
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
Master Page can be good idea.
|
|
|
|
|
Do the other apps use master pages, and, if so, can you have their master pages inherit from your new master page?
|
|
|
|
|
Hi fellows,
I have a Gridview with paging enabled. I wanted to display the 3rd page record of the gridview without clicking on the paging buttons at the bottom of the gridview. I couldn't find a way to do.
I have tried to call the gridview_PageIndexChanging event manually but it doesn't get called. I google it but couldn't find anything, Coud anyone help me with it?
Thanks
|
|
|
|
|
You can set the GridView.PageIndex and that should change the page for you. MSDN link[^]
|
|
|
|
|
You can direct set pageIndex property of the gridview in page load event like below code
GridView1.PageIndex = 2;
Page index starts from 0 so 2 will display page 3 in gridview.
Hope this might help you.
My DotNet Stuff
|
|
|
|
|
hello everyone!
There is a problem everyone would help.
In ASP.NET you want to display column color by number, while increasing the number of colors in the column increases.
Eg illustrations:http://www.cuocsongso.com/forum/attachment.php?attachmentid=11461&d=1302169075">
Please guide source
|
|
|
|
|
You've also asked this in Q&A: DO NOT CROSS POST!
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Hi,
Am using the following code to export data to excel
excelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();
object oMissing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Excel.Workbook excelBook = excelApp.Workbooks.Open(excelFilePath, oMissing, false, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing, oMissing);
Microsoft.Office.Interop.Excel.Worksheet excelSheet = (Microsoft.Office.Interop.Excel.Worksheet)excelBook.Sheets.Add(oMissing, oMissing, oMissing, oMissing);
the below error occurs
"Unauthorized access error.:Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005."
|
|
|
|
|
Is it possible the file is read-only or otherwise not accessible by the IIS_User account?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Dim attachment As String = "attachment; filename=excel.xls"
Response.ClearContent()
Response.AddHeader("content-disposition", attachment)
Response.ContentType = "application/ms-excel"
Dim sw As New StringWriter()
Dim htw As New HtmlTextWriter(sw)
Dim frm As New HtmlForm()
GVLeo.Parent.Controls.Add(frm)
frm.Attributes("runat") = "server"
frm.Controls.Add(GVLeo)
frm.RenderControl(htw)
Response.Write(sw.ToString())
Response.End()
|
|
|
|
|
Response.ContentType = "Application/vnd.ms-excel";
Hope this will work for you.
|
|
|
|
|
Hi Beula,
This is ramkumar_cmots..Nice to c u in this forum... trying ur mobile no.. but it is not reachable
send ur mobile no to cyberramkumar@gmail.com
Ramkumar
("When you build bridges you can keep crossing them. ")
http://ramkumarishere.blogspot.com
|
|
|
|
|
Hello everyone,
I am building an asp .net project and hosting on an XP Pro machine for a class project. For some reason random images decide not to load and it doesn't happen with any consistency. Sometimes one browser works better than another, sometimes they all work great. The only consistency is that when I click any one of the clickable images, the whole screen refreshes properly. Now nearly everything is wrapped up in update panels in the page but I don't see any reason why they wouldn't update properly. Does this ring a bell with anyone? Anyone have an idea what can cause this? Everything works perfectly in development (VS 2010, Win 7 64 Pro). I have tried disabling all anti-virus software and firewalls with no benefit.
Thanks to anyone who has read this far. And special thanks to anyone who has any suggestions.
FJ
|
|
|
|
|
fjaccarino wrote: hosting on an XP Pro machine
IIS installed in XP Pro is having some limitations like it will accept only a maximum of 10 connections simultaneously. This can be one reason of this weird behavior. Please use a proxy tool like fiddler (free from MS) for verifying the responses of broken images.
You may take any of the following steps.
1. Use sprite images instead of a lot of images.
2. Use caching of images at client side.
3. Use another OS (Windows 2003 server or similar) for hosting the site
Hope this helps.
"Never put off until run time what you can do at compile time."
- David Gries, in "Compiler Construction for Digital Computers", circa 1969.
|
|
|
|
|
guys;
I have worked on this article ^. and i have some proplems in the last code block ; if the calling button was a link button i can get the postback reference as easy as a peice of cake by getting the href,see
<a href="postback reference" />
but this doesnt work with image buttons and buttons with submit behavior
please help me on this becase i am stuck.
Help people,so poeple can help you.
|
|
|
|
|
Disclaimer: Company limitation requires me to code in classic asp and not .Net
Brain fried. I've tried rearranging this a million different ways and not getting the right result. What I want is, if the user selects "YES" on the message box, it redirects to another page. The actual message box appears fine, but I don't know how to pass that Yes variable to my code to redirect to the other page.
<%Dim DeckName, DeckNo
DeckName = Request.QueryString("DeckName")
DeckNo = Request.QueryString("DeckNo")
If Request.QueryString("Change") = "Y" then %>
<script language="VBScript">
Msgbox "Would you like to also update UMID Deck Rev Number?", vbYesNo
'And if the user selects Yes, then Response.Redirect("UMID_EditDeck.asp?DeckNum=" & DeckNo)
</script>
<% End If %>
Someone unscramble my brain, please.
----------------------------------
I'm not a programmer by trade, so please don't beat me unmerciful.
|
|
|
|
|
result=Msgbox "Would you like to also update UMID Deck Rev Number?", vbYesNo
If result = vbYes Then
Response.Redirect("UMID_EditDeck.asp?DeckNum=" & DeckNo)
Else
'Do what you want
End If
Is this what you are looking for? Sorry if I misunderstood your question, been a slow day here.
|
|
|
|
|
You can use javascript as well for this:
<%Dim DeckName, DeckNo
DeckName = Request.QueryString("DeckName")
DeckNo = Request.QueryString("DeckNo")
If Request.QueryString("Change") = "Y" then %>
<script type="text/javascript">
var r=confirm("Would you like to also update UMID Deck Rev Number?");
if (r==true)
{
window.location.replace("UMID_EditDeck.asp?DeckNum=<%=DeckNo%>");
}
}
</script>
<% End If %>
Om Prakash Pant
|
|
|
|
|
Hi, I am trying to read excel file uploaded by the user. So the excel sheet name varies by the user. So if I give particular sheet name, it is working fine but I want to get the sheet name automatically when the user uploads the excel file. The sheet name should be the name of the current sheet opened in the excel file. How to do that ?
For example:
if my code below is like this:
protected void ExcelConnection(string filename)
{
string xConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + Server.MapPath(Session["foldername"].ToString() + filename) + ";" + "Extended Properties=Excel 8.0;";
OleDbConnection objXConn = new OleDbConnection(xConnStr);
OleDbDataAdapter objDataAdapter = new OleDbDataAdapter();
string query;
grdViewUserIDs.DataSource = "";
try
{
objXConn.Open();
query = "select * from [Sheet1$]";
OleDbCommand objCommand = new OleDbCommand(query, objXConn);
objDataAdapter.SelectCommand = objCommand;
DataSet objDataSet = new DataSet();
objDataAdapter.Fill(objDataSet);
grdViewUserIDs.DataSource = objDataSet.Tables[0].DefaultView;
grdViewUserIDs.DataBind();
query = "";
objDataSet.Clear();
}
catch (Exception ex)
{
string t;
t = ex.ToString();
}
finally
{
objXConn.Close();
}
}
In the above code, how to replace [Sheet1$] with the current excel sheet name ?
suchita
|
|
|
|