Pulling Content From A File?
Mar 17, 2010
My company uses SharePoint 2007 as a CMS. We have a set of publishing sites. When servers go down, we would like to apply a status message. It doesn't have to be automatically applied, just would appear on first load (if a message exists) or a subsequent refresh. Here's how we would like it to work:
- Status message is located in a text file on the server.
- When a page loads, we would like each it to check to see if there is anything in the text file, and if so, display the message on the page.
- If the text file is empty, we would like it not to display anything on the page.
I can think of a few different ways this could be accomplished using PHP or something, but I'm at a loss as how to do it within SharePoint. Ideally we would be able to place such a block of code into the masterpage.
View 4 Replies
Similar Messages:
Nov 4, 2010
I am having a slight issue with grabbing data from my masterpage into my content page (as a whole).
I have generated a public property for the my textbox and the contentpage can see this public property. But it comes across empty (even from within the masterpage). Now I guess the problem is with the property itself (possibly). It also shows as empty when I response.write it's value to the page.
Even when I call the value of the property in the masterpage it comes across as empty. The way I have this setup is that a textbox named pageTitleField has it's value updated from an iframe. All is working well and the textbox has its value updated correct upon iframe content changes. This is great. Now I just need to pass this textbox value into my content page and then set it as the document title.
see my code thus far.
My MasterPage
[Code]....
My MasterPage CodeFile
[Code]....
My ContentPage
[Code]....
My ContentPage CodeFile
[Code]....
I know the public property is being seen from the content page because if I just do a Response.Write(Master.GrabPageTitle) I see System.Web.UI.WebControls.TextBox appearing as the output of that property. So it appears hat the textbox value is not being captured in the public readonly property.
View 5 Replies
May 14, 2010
how to use zippackage class to know about the content in .zip file?for ex to know the type of file inside this zip file.
View 1 Replies
May 20, 2010
I would like to use HTML input file type in my aspx page to allow user to browse for a excel file and then read the content of the excel sheet programmatically.If I want to read the excel sheet I need the full path of the file to connect to the excel sheet using asp.net.I do not understand how can I get the full path of the file.I know I can get the filename using postedFile.FileName property.But I need the full path of the file.
View 2 Replies
Oct 18, 2010
it should be easy but i can't find the answer
and it's been a while since iv'e done something with asp.net..
what i have now is a regular html pages website.
in some of the pages i have galleries,
I would like to make an aspx page to manage the content of the galleries or any other set-in advance content.
It's kind of a CMS, but it's not, since i would not be using a database.
what i want is just to get the admin's content from the aspx page
and send it to overwrite the images or the content of the DIVS in the html page.
at the final outcome, i will only want to have html files and one aspx file for the admin's editing use.
what is the most simple way to do that without using CMS?
View 3 Replies
Jan 5, 2011
I would like to find a way to read a txt file (in my case delimited by ¤). I need to change the order of the columns and also add and remove some columns. My output file should be a txt file delmited by ;.
I tried Jet.OLEDB to read the file and put it into a datatable and then used a stringBuilder and streamwriter to get an output file in .txt format. However. This does not me since I´, reading the txt file from start to end and my output will be the same. It does not seem like I can have a custom sql statement when reading the file. The only query that works is
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from 1.txt", TextConn)
How can I possible modify a txt file?
This is my code for now:
[Code]....
View 1 Replies
Nov 14, 2010
[Code]....
View 2 Replies
Apr 17, 2010
i have stored the txt file to sql server database .
i need to read the txt file line by line to get the content in it.
my code :
[code]....
but here i have used the FileStream to read from the Particular path. but i have saved the txt file in byte format into my Database. how to read the txt file using the byte[] value to get the txt file content, instead of using the Path value.
View 2 Replies
Sep 2, 2010
userName = Global.getComponent('centerRegion').UserName.getValue();
That code pops up with the error
{"browserEvent":"'Global.getComponent(...).UserName' is null or not an object","button":-1,"ctrlKey":false,"xy":[0,0]}
When I run it on this form:
Using Form As New WebControls.Forms.Form
With Form
.ID = "Test"
.ItemName = "connector"
With .Toolbar
.UseDefaultButtons = False
.AddButton(Forms.FormToolbar.ButtonType.Save)
.AddButton(Forms.FormToolbar.ButtonType.Cancel)
.AddButton("Test Connection", "testConnection", "icon-button-testconnection", , "Test")
End With
With .CenterRegion
.Id = "centerRegion"
With .AddFieldSet("Activate Service")......................
View 2 Replies
Jun 14, 2010
I have written a web scraping program to go to a list of pages and write all the html to a file. The problem is that when I pull a block of text some of the characters get written as '�'. How do I pull those characters into my text file? Here is my code:
string baseUri = String.Format("http://www.rogersmushrooms.com/gallery/loadimage.asp?did={0}&blockName={1}", id.ToString(), name.Trim());
// our third request is for the actual webpage after the login.
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(baseUri);
request.Method = "GET";
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)";
//get the response object, so that we may get the session cookie.
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
// and read the response
string page = reader.ReadToEnd();
StreamWriter SW;
string filename = string.Format("{0}.txt", id.ToString());
SW = File.AppendText("C:\Share\" + filename);
SW.Write(page);
reader.Close();
response.Close();
View 3 Replies
Mar 23, 2011
I have two tables:
Entity
ID (PK), int
Name
Descrip
Users
ID (PK)
EntityID, int (this is not connected to Entity table)
Now I am using LINQ to pull the records which has a Entity.ID = something. Which will show me couple of records in my GridView. Here is my LINQ statement:
protected void Page_Load(object sender, EventArgs e)
{
string getEntity = Request.QueryString["EntityID"];
int getIntEntity = Int32.Parse(getEntity);
OISEntityTestingDataContext db = new OISEntityTestingDataContext();
//OISLinqtoSQLDataContext db = new OISLinqtoSQLDataContext();
var tr =
from r in db.Users
join s in db.Entities on r.UserID equals s.ID
where s.ID == getIntEntity
select new
{
//To Show Items in GridView!
};
GridView1.DataSource = tr;
GridView1.DataBind();
}
Now here I am getting an error mesg on 'join' The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join What does that mean?
View 3 Replies
Dec 21, 2010
I'm getting ready to start a C# web application project and just wanted some opinions regarding pulling data from a database. As far as I can tell, I can either use C# code to access the database from the code behind (i.e. LINQ) of my web app or I can call a stored procedure that will collect all the data and then read it with a few lines of code in my code behind. I'm curious to know which of these two approaches, or any other approach, would be the most efficient, elegant, future proof and easiest to test.
View 3 Replies
Jan 15, 2010
I recently designed a website for a school, I have their result in my database, I am using Northwind. What I want to do is, since all the result are in the data, I want to input a students name, exam number and some numbers in a card(exam scratch card, which they will purchase) they will purchase. When they input these details, the students results will be pulled out from the database.
Just like exam result portal, where you will look up your result with, your name, school number and numbers from the scratch card.
View 6 Replies
Sep 27, 2010
I have to pull up a list of people by their branch number which could vary, and give a detailed report on there performance using a select queries. I have the select queries but how can i create a script to look similar to this one. Ive got the branch drop downlist already created just need to know how i can go about pulling all the users in this group and doing this select to all of them. someone told me I might need to use cursors to loop thru a select with every person in the list but im not sure how to go about that.
select fldusername from tbluser where fldio='o' and
flduserbranch=@branchid
is going to give me the names of the people i need to query. but how can i run a query on each of them seperate?
View 3 Replies
Jun 28, 2010
I'm trying to pull a value from a Gridview so that I can create a running subtotal. I've looked at a number of examples but they all seem to fail.
Why does this not work? Each and every reference I try to make to the cells "value", comes up null.
Sample code1:
[Code]....
Sample code2:
[Code]....
In sample code 2, I get the "header text" for the column...but I know the value in the cell...so it fails on a data conversion.
View 5 Replies
Feb 17, 2010
I was hired to do some contract work for a short contract. I am looking at this code on this Aspx web form. What they do is load the labels for a radio button list from an ObjectDataSource object. Well this is the first time I have ever heard of an ObjectDataSource. The problem is that I don't even know where this object is pulling data from. With a SqlDataSource object, I can easily view the flyout menu to see the sql query where the data is being pulled from. Anyway, I need some figuring out where objectDataSourcePlanType lives and where it is pulling data from. I know I can't list the entire project, but I am sure someone who is familiar with ObjectDataSource
<tr>
<td>Type of Plan</td>
<td><img alt="Required" src="/Images/arrow.png" /></td>
<td>
<asp:RadioButtonList ID="radioButtonListPlanType" runat="server" AutoPostBack="True" DataSourceID="objectDataSourcePlanType"
DataTextField="PlanTypeName" DataValueField="PlanTypeId" OnSelectedIndexChanged="RadioButtonListPlanType_SelectedIndexChanged"
RepeatColumns="1" RepeatDirection="Vertical" AppendDataBoundItems="true">
</asp:RadioButtonList>
<asp:RequiredFieldValidator ID="requiredFieldValidator10" runat="server" ControlToValidate="radioButtonListPlanType" ErrorMessage="Type
of Plan is required."
SetFocusOnError="true" />
<asp:ObjectDataSource ID="objectDataSourcePlanType" runat="server" SelectMethod="ListPlanTypes" TypeName="Candle.Web.PlanRequest.CommonWeb">
</asp:ObjectDataSource>
</td>
</tr>
View 2 Replies
Mar 4, 2011
I have 50 sites for 50 states. When a company uploads their contact info their image is stored in a folder relative to the site they are uploading from. When you view this company on the other sites the image is not present. So, I was thinking I would store the path of where the file is originally and then access it through the handler, but I can't seem to get the handler to recognize locations other than virtual directories.
[Code]....
View 3 Replies
Sep 19, 2010
I am trying to avoid enabling EnableViewState..Sample code as you can see has 1 repeater and 2 textboxes inside. I bind the textboxes at page init. After a postback I want to get the updated data from the client & save in a db. The Request.Form contains the data keyed with autogenerated client ids but the repeater has 0 items after the postback. So my options seem limited to.a. Enable viewstate so I can pull the data from the repeater using Control.Find(...)b. iterate through Request.Form and find my textbox values...ultimatly the goal is to to render data from a datatable to some textboxes, allow the user to make changes then save these changes. I'd like to avoid viewstate if there is a clean alternative..ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Foo.aspx.cs" Inherits="Ads_Foo" EnableViewState="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
[code]...
View 1 Replies
Feb 1, 2011
So I have been trying to follow serenarules posts about persistence layers, but I seem to be missing something.
The persistence layer is an architectural layer whose job is to provide an abstract interface to information storage mechanism(s).
This makes sense to me, but I am still having a hard time with this.
So in what cases is this necessary? When you are pulling similar data from multiple information sources?
View 7 Replies
Feb 25, 2010
we have a program that we work with with in 2 different locations, both of the program instances must share the same database.what i did is to open Web Sharing folder on our server then i added on both computers this folder to their "My network places" and direct both of application to this folder which contains the database.this is how i direct the program :
Code:
D:WNKKWnkk.exe \MyServerktest
nk2008
it all works fine but there is one problem, the data pulling is pretty slow when it shouldn't we have 100MB download / upload on our server and over 10MB dl/ul in our office.
some pointers:i added the shared web folder to one of our website directory and thats mean that the port the program is using is 80
is port 80 is slower then others?
View 10 Replies
Feb 3, 2010
I currently designed a school result portal. If the students want to view their result, they input their student school number in a text box to search out their result. But this is not secured because anybody can look up any students result if you have the number which is even written on their school uniform for identification.
I have being trying to secure this result by trying to generate or code special numbers that the students will input with their school number. The special numbers will be random numbers and may be from 10 and above, it might even contain letters. How do
I code this. I believe this is the best asp.net forum. I want the students to be inputing this special unique numbers and their student numbers so that there result will be avaliable to them.
View 2 Replies
Jul 27, 2010
I have searched endlessly for an answer but found nothing useful! I'm writing a simple blog application using Web Matrix and its going pretty well, but I have run in to a problem. I am storing the content of each blog post in a ntext field in a table with the intention of entering HTML in to the database and then have my application pull it out and insert it in to a few different view pages. The problem is that all of the '<' and '>' characters are getting converted in to '<' and '>' when my application pulls the HTML from the database and displays it. I understand that this is for security (preventing code injection?), but only trusted users will ever be able to write posts using my application. Here is a screen shot of what gets displayed by my application:
Is there a way to disable this behaviour or work around it somehow?
View 3 Replies
May 12, 2010
The DoctorGen Table has primary key DocId and Doctors has Keys set on DocId and MemId. I want to get all records from DoctorGen where UserID = @UserId even if there are no matches in the Doctors Table. I'm not getting any records.
[Code]....
View 13 Replies
Nov 23, 2010
I have a GridView, bound to a table (Meals) in a SqlDataSource.
Into that GridView, I have added a TemplateField, which contains a DropDownList (which displays the numbers 1 - 10, added manually; no Data Binding). And, I've added a ButtonField.
When I click the Button, I want the values of some of the GridView rows PLUS whatever value was selected in the DropDownList to be pulled out and stored in a second Sql table (Orders).
Pulling the rows bound to the SqlDataSource is easy but JavaScript is needed (I think) to pull the SelectedValue from the DropDownList. I understand women more than understand JavaScript (that's how little I know) and the code below has been kindly offered by another forum user who is at a loss, himself, now.
Here's the code and the error message I'm getting.
ASPX:
[Code]....
And here's the Code Behind:
[Code]....
No design time errors reported but here's the run time error:
Object reference not set to an instance of an object.
On the following line:
Line 28: if (row.RowType == DataControlRowType.DataRow)
View 6 Replies
Nov 29, 2010
I'm creating a pseudo invoicing system. I've got a webform where users can pick such informaiton as days, companies, etc to pull the information to create the invoice for and then they click a submit button. I'm wondering what the easiest method would be to get this information. I've had success with such commands as:
DropDownList SourceTextBox = (DropDownList)Page.PreviousPage.FindControl("DropDownList2");
but how can you pull this information through the SQLDataSource tools? When I choose to alter the "WHERE" in the sql clause to a control items in the previous page are not accessible.
View 1 Replies